2230173_宁德吉利极片库WCS代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.5 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ILDashBoardOEE
{
public partial class FrmTaskStat : Form
{
private static string dayweekmonth;
public static string Dayweekmonth
{
get { return FrmTaskStat.dayweekmonth; }
set { FrmTaskStat.dayweekmonth = value; }
}
private static FrmTaskStat _formInstance;
public static FrmTaskStat FormInstance
{
get
{
if (_formInstance == null)
{
_formInstance = new FrmTaskStat();
}
return _formInstance;
}
set { _formInstance = value; }
}
public FrmTaskStat()
{
InitializeComponent();
_formInstance = this;
}
private void FrmTaskStat_Load(object sender, EventArgs e)
{
if (dayweekmonth == "month")
{
this.dateTimePicker2.Value = DateTime.Now.Date;
this.dateTimePicker1.Value = DateTime.Now.Date.AddMonths(-1);
this.Text = "任务统计月报表";
}
else if (dayweekmonth == "week")
{
this.dateTimePicker2.Value = DateTime.Now.Date;
this.dateTimePicker1.Value = DateTime.Now.Date.AddDays(-7);
this.Text = "任务统计周报表";
}
else //if (dayweekmonth == "day")
{
this.dateTimePicker2.Value = DateTime.Now.Date;
this.dateTimePicker1.Value = DateTime.Now.Date;
this.Text = "任务统计日报表";
}
// TODO: 这行代码将数据加载到表“SSWCS_dsOEEToday.V_OEEToday”中。您可以根据需要移动或删除它。
this.V_OEETodayTableAdapter.Fill(this.SSWCS_dsOEEToday.V_OEEToday, this.dateTimePicker1.Value.ToString("u").Substring(0, 10), this.dateTimePicker2.Value.ToString("u").Substring(0, 10));
this.V_ScheduledDailyTaskCountTableAdapter.Fill(this.SSWCS_dsOEEToday.V_ScheduledDailyTaskCount, this.dateTimePicker1.Value.ToString("u").Substring(0, 10), this.dateTimePicker2.Value.ToString("u").Substring(0, 10));
this.reportViewer1.RefreshReport();
}
private void button1_Click(object sender, EventArgs e)
{
this.V_OEETodayTableAdapter.Fill(this.SSWCS_dsOEEToday.V_OEEToday, this.dateTimePicker1.Value.ToString("u").Substring(0, 10), this.dateTimePicker2.Value.ToString("u").Substring(0, 10));
this.V_ScheduledDailyTaskCountTableAdapter.Fill(this.SSWCS_dsOEEToday.V_ScheduledDailyTaskCount, this.dateTimePicker1.Value.ToString("u").Substring(0, 10), this.dateTimePicker2.Value.ToString("u").Substring(0, 10));
this.reportViewer1.RefreshReport();
}
private void dateTimePicker2_ValueChanged(object sender, EventArgs e)
{
if (dayweekmonth == "month")
{
this.dateTimePicker1.Value = this.dateTimePicker2.Value.AddMonths(-1);
}
else if (dayweekmonth == "week")
{
this.dateTimePicker1.Value = this.dateTimePicker2.Value.AddDays(-7);
}
else //if (dayweekmonth == "week")
{
this.dateTimePicker1.Value = this.dateTimePicker2.Value;
}
}
}
}