我叫锄头 10 months ago
parent 4e60abd5f1
commit 97e842c0a7

@ -1,4 +1,6 @@
using DevExpress.Utils.Extensions;
using DataBlockHelper.DBHelpers;
using DevExpress.Utils.Extensions;
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
@ -31,6 +33,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
List<GhWuLiaoIniEntity> list;
MCButton WhiteWork;
MCButton NightWork;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
@ -45,6 +51,15 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
endTime = control.FirstOrDefault(x => x.Name == "endTime") as MCDateTimePicker;
dataGridView.AutoGenerateColumns = true;
WhiteWork = control.FirstOrDefault(x => x.Name == "WhiteWork") as MCButton;
NightWork = control.FirstOrDefault(x => x.Name == "NightWork") as MCButton;
WhiteWork.Click += WhiteWork_Click;
NightWork.Click += WhiteWork_Click;
startDate.Value = DateTime.Now.AddDays(-1);
selectButton.Click += SelectButton_Click;
@ -71,7 +86,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
private void SelectButton_Click(object sender, EventArgs e)
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dt = GetDefault();
DateTime starttime = startDate.Value.Date.AddHours(startTime.Value.Hour).AddMinutes(startTime.Value.Minute).AddSeconds(startTime.Value.Second);
@ -79,7 +94,39 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
string statValue = starttime.ToString("yyyy-MM-dd HH:mm:ss");
string endValue = endtime.ToString("yyyy-MM-dd HH:mm:ss");
FillData(statValue, endValue);
}
private void WhiteWork_Click(object sender, EventArgs e)
{
DateTime nowTime = DateTime.Now;
DateTime starttime;
DateTime endtime;
//如果大于当天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);
}
string statValue = starttime.ToString("yyyy-MM-dd HH:mm:ss");
string endValue = endtime.ToString("yyyy-MM-dd HH:mm:ss");
FillData(statValue, endValue);
}
private void FillData(string statValue, string endValue)
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
list = new List<GhWuLiaoIniEntity>();
for (int i = 1; i < 5; i++)
@ -160,8 +207,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
this.dataGridView.DataSource = null;
this.dataGridView.DataSource = dt;
}
private DataTable GetDefault()

@ -1,4 +1,6 @@
using DevExpress.DataProcessing;
using DataBlockHelper.DBHelpers;
using DevExpress.DataProcessing;
using DevExpress.Utils.Extensions;
using Mesnac.Action.Base;
@ -35,6 +37,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
List<DayWhiteEmbryoEntity> list;
MCButton WhiteWork;
MCButton NightWork;
List<DayWhiteEmbryoEntity> listMore;
public void Run(RuntimeParameter runtime)
{
@ -57,6 +62,13 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
dataGridView.CellClick += MoreData_Click;
WhiteWork = control.FirstOrDefault(x => x.Name == "WhiteWork") as MCButton;
NightWork = control.FirstOrDefault(x => x.Name == "NightWork") as MCButton;
dt = new DataTable();
dt.Columns.Add("机台", typeof(string));
dt.Columns.Add("玉米粉总量", typeof(string));
@ -89,14 +101,49 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
private void SelectButton_Click(object sender, EventArgs e)
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dt.Rows.Clear();
hus.Clear();
DateTime starttime = startDate.Value.Date.AddHours(startTime.Value.Hour).AddMinutes(startTime.Value.Minute).AddSeconds(startTime.Value.Second);
DateTime endtime = endDate.Value.Date.AddHours(endTime.Value.Hour).AddMinutes(endTime.Value.Minute).AddSeconds(endTime.Value.Second);
string statValue = starttime.ToString("yyyy-MM-dd HH:mm:ss");
string endValue = endtime.ToString("yyyy-MM-dd HH:mm:ss");
FileData(statValue, endValue);
}
private void WhiteWork_Click(object sender, EventArgs e)
{
DateTime nowTime = DateTime.Now;
DateTime starttime;
DateTime endtime;
//如果大于当天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);
}
string statValue = starttime.ToString("yyyy-MM-dd HH:mm:ss");
string endValue = endtime.ToString("yyyy-MM-dd HH:mm:ss");
FileData(statValue, endValue);
}
private void FileData(string statValue, string endValue)
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dt.Rows.Clear();
hus.Clear();
for (int i = 1; i < 9; i++)
{
@ -182,9 +229,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
dt.Rows.Add(totalDow);
dataGridView.DataSource = dt;
}
private void MoreData_Click(object sender, EventArgs e)

@ -32,16 +32,83 @@
<Property name="Dock">Fill</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">MCDataGridView1</Property>
<Property name="Size">1171, 619</Property>
<Property name="Size">1171, 538</Property>
<Property name="TabIndex">12</Property>
</Object>
<Property name="Dock">Fill</Property>
<Property name="Location">0, 77</Property>
<Property name="Location">0, 158</Property>
<Property name="Name">Panel3</Property>
<Property name="Size">1171, 619</Property>
<Property name="Size">1171, 538</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel2" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox1" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="NightWork" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">夜班统计</Property>
<Property name="Location">177, 93</Property>
<Property name="Name">NightWork</Property>
<Property name="Size">120, 31</Property>
<Property name="TabIndex">19</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WhiteWork" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">白班统计</Property>
<Property name="Location">11, 93</Property>
<Property name="Name">WhiteWork</Property>
<Property name="Size">120, 31</Property>
<Property name="TabIndex">18</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel1" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">当前或最近一次班次统计</Property>
<Property name="Location">11, 68</Property>
<Property name="Name">MCLabel1</Property>
<Property name="Size">137, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCDateTimePicker, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="endTime" children="Controls">
<Property name="ValueChangedList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
@ -148,13 +215,13 @@
<Property name="Text">统计查询</Property>
<Property name="Location">9, 3</Property>
<Property name="Name">GroupBox1</Property>
<Property name="Size">868, 64</Property>
<Property name="Size">962, 139</Property>
<Property name="TabIndex">11</Property>
</Object>
<Property name="Dock">Top</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">Panel2</Property>
<Property name="Size">1171, 77</Property>
<Property name="Size">1171, 158</Property>
</Object>
<Property name="Dock">Fill</Property>
<Property name="Location">0, 0</Property>

@ -32,16 +32,83 @@
<Property name="Dock">Fill</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">MCDataGridView1</Property>
<Property name="Size">650, 788</Property>
<Property name="Size">650, 705</Property>
<Property name="TabIndex">9</Property>
</Object>
<Property name="Dock">Fill</Property>
<Property name="Location">0, 74</Property>
<Property name="Location">0, 157</Property>
<Property name="Name">Panel4</Property>
<Property name="Size">650, 788</Property>
<Property name="Size">650, 705</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel3" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox1" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="NightWork" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">夜班统计</Property>
<Property name="Location">177, 97</Property>
<Property name="Name">NightWork</Property>
<Property name="Size">120, 31</Property>
<Property name="TabIndex">22</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WhiteWork" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">白班统计</Property>
<Property name="Location">11, 97</Property>
<Property name="Name">WhiteWork</Property>
<Property name="Size">120, 31</Property>
<Property name="TabIndex">21</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel1" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">当前或最近一次班次统计</Property>
<Property name="Location">11, 72</Property>
<Property name="Name">MCLabel1</Property>
<Property name="Size">137, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCDateTimePicker, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="endTime" children="Controls">
<Property name="ValueChangedList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
@ -148,13 +215,13 @@
<Property name="Text">统计查询</Property>
<Property name="Location">3, 3</Property>
<Property name="Name">GroupBox1</Property>
<Property name="Size">644, 60</Property>
<Property name="Size">644, 148</Property>
<Property name="TabIndex">10</Property>
</Object>
<Property name="Dock">Top</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">Panel3</Property>
<Property name="Size">650, 74</Property>
<Property name="Size">650, 157</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel2" children="Controls">
<Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MoreData" children="Controls">

Loading…
Cancel
Save