|
|
|
@ -89,8 +89,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
|
|
|
|
|
//selectButton.Click += SelectButton_Click;
|
|
|
|
|
//dataGridView.CellClick += MoreData_Click;
|
|
|
|
|
//dataGridView.CellValueChanged += MoreData_Click;
|
|
|
|
|
//WhiteWork.Click += WhiteWork_Click;
|
|
|
|
|
//NightWork.Click += NightWork_Click;
|
|
|
|
|
WhiteWork.Click += WhiteWork_Click;
|
|
|
|
|
NightWork.Click += WhiteWork_Click;
|
|
|
|
|
|
|
|
|
|
SelectButton_Click(new object(),new EventArgs());
|
|
|
|
|
MoreData_Click(new object(), new EventArgs());
|
|
|
|
@ -118,18 +118,42 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
|
|
|
|
|
DateTime starttime;
|
|
|
|
|
DateTime endtime;
|
|
|
|
|
|
|
|
|
|
//如果大于当天8点 就展示当天的白班 否则展示上一个白班
|
|
|
|
|
if (nowTime >= DateTime.Now.Date.AddHours(8))
|
|
|
|
|
if (((Button)sender).Text.Contains("白"))
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(7).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(19).AddMinutes(30);
|
|
|
|
|
//如果大于当天8点 就展示当天的白班 否则展示上一个白班
|
|
|
|
|
if (nowTime >= DateTime.Now.Date.AddHours(8))
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(7).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(19).AddMinutes(30);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(-17).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(-5).AddMinutes(30);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(-17).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(-5).AddMinutes(30);
|
|
|
|
|
//如果小于当天20点 就展示当天的前一个晚班
|
|
|
|
|
if (nowTime <= DateTime.Now.Date.AddHours(20))
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(-5).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(7).AddMinutes(30);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
starttime = DateTime.Now.Date.AddHours(19).AddMinutes(30);
|
|
|
|
|
endtime = DateTime.Now.Date.AddHours(31).AddMinutes(30);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
startDate.Value = Convert.ToDateTime(starttime.ToString("yyyy-MM-dd"));
|
|
|
|
|
endDate.Value = Convert.ToDateTime(endtime.ToString("yyyy-MM-dd"));
|
|
|
|
|
|
|
|
|
|
startTime.Value = Convert.ToDateTime(starttime.ToString("HH:mm:ss"));
|
|
|
|
|
endTime.Value = Convert.ToDateTime(endtime.ToString("HH:mm:ss"));
|
|
|
|
|
|
|
|
|
|
string statValue = starttime.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
string endValue = endtime.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
FileData(statValue, endValue);
|
|
|
|
|