输入框只能输入数字的校验//字段非空校验并定位焦点

 输入字符串等不符合要求的值需要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"));

 

转载于:https://my.oschina.net/8824/blog/3085594

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值