输入字符串等不符合要求的值需要return;
protected override void ExecSaveEvent()
{
DataTable dt = new DataTable();
string sBatchId = txtBatchID.Text;//"TEST"
string sFinalDecision = comboBoxEdit1.Text;
int sQtyPass = 0;
int sQtyFail = 0;
if (sFinalDecision == "部分合格")
{
if((CommonFunction.CheckValue(textEdit1, CHECK_VALUE_TYPE.Numeric))== true)
{
sQtyPass = Convert.ToInt32(textEdit1.Text);
}
else
{
return;
}
if ((CommonFunction.CheckValue(textEdit2, CHECK_VALUE_TYPE.Numeric)) == true)
{
sQtyFail = Convert.ToInt32(textEdit2.Text);
}
else
{
return;
}
}
if(!string.IsNullOrEmpty(sBatchId))
{
dt = QCMLIST.ViewQCMInspBatch(sBatchId);
if (dt == null)
{
CommonFunction.ShowMsgBox("不存在批号:" + sBatchId);
return;
}
}
if ((CommonFunction.CheckValue(txtBatchID, CHECK_VALUE_TYPE.NotNull)) == false)
{
return;
}
if ((CommonFunction.CheckValue(comboBoxEdit1, CHECK_VALUE_TYPE.NotNull)) == false)
{
return;
}
DataTable dt1 = QCMLIST.JudgeQcmFinalDecision(sBatchId, sFinalDecision, sQtyPass, sQtyFail);
if (dt1!=null)
{
CommonFunction.ShowMsgBox("保存成功!");
}
return;
}
==================
if (gluCOATemplate.Text == "")
{
CommonFunction.ShowMsgBox("请选择模板ID");
gluCOATemplate.Focus();
return ;
}
if (txtLotID.Text == "")
{
CommonFunction.ShowMsgBox("检查批号不能为空");
txtLotID.Focus();
return ;
}
另:时间格式转换:
txtCreateTime.Text = CommonFunction.MakeDateFormat(out_node.GetString("CREATE_TIME"));