add - 湿混机等待时间统计添加数值溢出错误捕捉

dep
wangsr 11 months ago
parent 435d1ea98a
commit 5dba184ec8

@ -149,18 +149,27 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime
dt.Rows.Add(dr);
}
var edr = dt.NewRow();
edr[0] = "湿混等待时间总和";
edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime));
dt.Rows.Add(edr);
var edr1 = dt.NewRow();
edr1[0] = "RGV等待时间总和";
edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime));
dt.Rows.Add(edr1);
var edr2 = dt.NewRow();
edr2[0] = "总等待时间总和";
edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime));
dt.Rows.Add(edr2);
try
{
var edr = dt.NewRow();
edr[0] = "湿混等待时间总和";
edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime));
dt.Rows.Add(edr);
var edr1 = dt.NewRow();
edr1[0] = "RGV等待时间总和";
edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime));
dt.Rows.Add(edr1);
var edr2 = dt.NewRow();
edr2[0] = "总等待时间总和";
edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime));
dt.Rows.Add(edr2);
}
catch (OverflowException ex)
{
MessageBox.Show("算术值溢出!请检查数据是否有误");
}
}
/// <summary>

@ -10,6 +10,7 @@ using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime
{
@ -225,18 +226,25 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime
dt.Rows.Add(dr);
}
var edr = dt.NewRow();
edr[0] = "湿混等待时间总和";
edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime));
dt.Rows.Add(edr);
var edr1 = dt.NewRow();
edr1[0] = "RGV等待时间总和";
edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime));
dt.Rows.Add(edr1);
var edr2 = dt.NewRow();
edr2[0] = "总等待时间总和";
edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime));
dt.Rows.Add(edr2);
try
{
var edr = dt.NewRow();
edr[0] = "湿混等待时间总和";
edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime));
dt.Rows.Add(edr);
var edr1 = dt.NewRow();
edr1[0] = "RGV等待时间总和";
edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime));
dt.Rows.Add(edr1);
var edr2 = dt.NewRow();
edr2[0] = "总等待时间总和";
edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime));
dt.Rows.Add(edr2);
}
catch (OverflowException ex)
{
MessageBox.Show("算术值溢出!请检查数据是否有误");
}
}
private string TimeConvert(int t)

@ -25,12 +25,11 @@
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="AutoGenerateColumns">False</Property>
<Property name="MultiSelect">False</Property>
<Property name="Location">348, 12</Property>
<Property name="Name">MoreData</Property>
<Property name="Size">530, 622</Property>
<Property name="TabIndex">7</Property>
<Property name="TabIndex">9</Property>
</Object>
<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="DataExport" children="Controls">

Loading…
Cancel
Save