点击新增按钮
{
ChkFormIDBox.Text = Coeno.DevChk.DevChk.CleanUpInput(ChkFormIDBox.Text); --清除表单文本框数据输入
if (string.IsNullOrEmpty(ChkFormIDBox.Text))
{
lblMsg.Text = "表单序号不能为空";
lblMsg.ForeColor = System.Drawing.Color.Red;
return;
}
DataTable da = Coeno.DevChk.DevChk.InjectMoldSNQue(ChkFormIDBox.Text); --通过表单号进行查找将结果返回数据表
if(da.Rows.Count > 0)
{
lblMsg.Text = " 表单序号已存在";
lblMsg.ForeColor = System.Drawing.Color.Red; --字体颜色为系统绘图颜色红色
}
else
{
XMLInjectMold XMLInjectMold = new XMLInjectMold();
XMLInjectMold = GetDataFormUI();
int result = Coeno.DecChk.InjectMold.AddXMLInjectMold(XMLInjectMold);
if(result ==0)
{
lblMsg.Text="添加成功";
lblMsg.ForeColor = System.Drawing.Color.Red;
}
}
da = Coeno.DevChk.DevChk.InjectMoldSNQue(ChkFormIDBox.Text);
if(da.Rows.Count>0)
{
gvInjectMoldChk.DataSource = null;
gvInjectMoldChk.DataBind();
gvInjectMoldChk.DataSource = da;
gvInjectMoldChk.DataBind;
}
ClearDataToUI();
}