Пример #1
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            //判断编号不能为空
            if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                strErrorlog += "编号不能为空!\r\n";
            }

            //判断名称不能为空
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                strErrorlog += "名称不能为空!\r\n";
            }

            if (strErrorlog != null)
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (CTools.GetTextBoxLength(txtName.Text) > txtName.MaxLength)
            {
                txtName.Text = CTools.textSpilt(txtName.Text, txtName.MaxLength);
            }

            return(true);
        }
Пример #2
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            //判断编号不能为空
            if (string.IsNullOrEmpty(this.txtCustomerCode.Text.Trim()))
            {
                strErrorlog += "客户编号不能为空!\r\n";
            }

            //判断地址编号不能为空
            if (string.IsNullOrEmpty(this.txtDeliveryCode.Text.Trim()))
            {
                strErrorlog += "地址编号不能为空!\r\n";
            }

            //判断地址名称不能为空
            if (string.IsNullOrEmpty(this.txtAddressFirst.Text.Trim()))
            {
                strErrorlog += "地址1不能为空!\r\n";
            }

            if (strErrorlog != null || "".Equals(strErrorlog))
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (CTools.GetTextBoxLength(txtContactName.Text) > txtContactName.MaxLength)
            {
                txtContactName.Text = CTools.textSpilt(txtContactName.Text, txtContactName.MaxLength);
            }
            return(true);
        }
Пример #3
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            if (string.IsNullOrEmpty(this.txtCustomer.Text.Trim()))
            {
                strErrorlog += "代理店不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(this.txtReported.Text.Trim()))
            {
                strErrorlog += "报备客户名称不能为空!\r\n";
            }

            if (strErrorlog != null)
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (CTools.GetTextBoxLength(txtReported.Text) > txtReported.MaxLength)
            {
                txtReported.Text = CTools.textSpilt(txtReported.Text, txtReported.MaxLength);
            }
            return(true);
        }
Пример #4
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            //判断编号不能为空
            if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                strErrorlog += "原料编号不能为空!\r\n";
            }
            //判断编号是否已存在
            else if (_mode != CConstant.MODE_MODIFY && bProduct.Exists(txtCode.Text.Trim()))
            {
                strErrorlog += "原料编号已存在。\r\n";
            }

            //判断名称不能为空
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                strErrorlog += "原料名称不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(this.txtUnitCode.Text.Trim()))
            {
                strErrorlog += "基本单位不能为空!\r\n";
            }

            //判断类别不能为空
            if (string.IsNullOrEmpty(this.txtGroupCode.Text.Trim()))
            {
                strErrorlog += "种类编号不能为空!\r\n";
            }

            //判断安全在库数不能为空
            if (string.IsNullOrEmpty(this.txtSafetyStock.Text.Trim()))
            {
                strErrorlog += "安全在库数不能为空!\r\n";
            }

            if (strErrorlog != null)
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (txtPrice.Text == null || "".Equals(txtPrice.Text))
            {
                txtPrice.Text = "0";
            }

            if (CTools.GetTextBoxLength(txtName.Text) > txtName.MaxLength)
            {
                txtName.Text = CTools.textSpilt(txtName.Text, txtName.MaxLength);
            }

            return(true);
        }
Пример #5
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            //判断编号不能为空
            if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                strErrorlog += "商品编号不能为空!\r\n";
            }

            //判断名称不能为空
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                strErrorlog += "商品名称不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(this.txtBasic.Text.Trim()))
            {
                strErrorlog += "基本单位不能为空!\r\n";
            }

            //判断类别不能为空
            if (string.IsNullOrEmpty(this.txtGroupCode.Text.Trim()))
            {
                strErrorlog += "类别编号不能为空!\r\n";
            }

            //判断安全在库数不能为空
            if (string.IsNullOrEmpty(this.txtSafetyStock.Text.Trim()))
            {
                strErrorlog += "安全在库数不能为空!\r\n";
            }

            if (strErrorlog != null)
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }

            if (txtPrice.Text == null || "".Equals(txtPrice.Text))
            {
                txtPrice.Text = "0";
            }

            if (CTools.GetTextBoxLength(txtName.Text) > txtName.MaxLength)
            {
                txtName.Text = CTools.textSpilt(txtName.Text, txtName.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtModelNumber.Text) > txtModelNumber.MaxLength)
            {
                txtModelNumber.Text = CTools.textSpilt(txtModelNumber.Text, txtModelNumber.MaxLength);
            }

            return(true);
        }
Пример #6
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            if (string.IsNullOrEmpty(txtCode.Text.Trim()))
            {
                strErrorlog += "用户编号不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtName.Text.Trim()))
            {
                strErrorlog += "用户名称不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtPassword.Text.Trim()))
            {
                strErrorlog += "用户密码不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtRePassword.Text.Trim()))
            {
                strErrorlog += "用户确认密码不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtCompanyCode.Text.Trim()))
            {
                strErrorlog += "公司编号不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtDepartmentCode.Text.Trim()))
            {
                strErrorlog += "部门编号不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(txtRolesCode.Text.Trim()))
            {
                strErrorlog += "角色不能为空!\r\n";
            }

            if (strErrorlog != null)
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (CTools.GetTextBoxLength(txtName.Text) > txtName.MaxLength)
            {
                txtName.Text = CTools.textSpilt(txtName.Text, txtName.MaxLength);
            }

            return(true);
        }
Пример #7
0
        /// <summary>
        /// 输入检查
        /// </summary>
        private bool CheckInput()
        {
            string strErrorlog = null;

            //判断编号不能为空
            if (string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                strErrorlog += "编号不能为空!\r\n";
            }

            //判断名称不能为空
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                strErrorlog += "名称不能为空!\r\n";
            }

            if (string.IsNullOrEmpty(this.txtClaimCode.Text.Trim()))
            {
                strErrorlog += "请款公司不能为空!\r\n";
            }

            if (strErrorlog != null || "".Equals(strErrorlog))
            {
                MessageBox.Show(strErrorlog, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (CTools.GetTextBoxLength(txtName.Text) > txtName.MaxLength)
            {
                txtName.Text = CTools.textSpilt(txtName.Text, txtName.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtNameShort.Text) > txtNameShort.MaxLength)
            {
                txtNameShort.Text = CTools.textSpilt(txtNameShort.Text, txtNameShort.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtAddressFirst.Text) > txtAddressFirst.MaxLength)
            {
                txtAddressFirst.Text = CTools.textSpilt(txtAddressFirst.Text, txtAddressFirst.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtAddressMiddle.Text) > txtAddressMiddle.MaxLength)
            {
                txtAddressMiddle.Text = CTools.textSpilt(txtAddressMiddle.Text, txtAddressMiddle.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtAddressLast.Text) > txtAddressLast.MaxLength)
            {
                txtAddressLast.Text = CTools.textSpilt(txtAddressLast.Text, txtAddressLast.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtMemo.Text) > txtMemo.MaxLength)
            {
                txtMemo.Text = CTools.textSpilt(txtMemo.Text, txtMemo.MaxLength);
            }

            if (CTools.GetTextBoxLength(txtContactName.Text) > txtContactName.MaxLength)
            {
                txtContactName.Text = CTools.textSpilt(txtContactName.Text, txtContactName.MaxLength);
            }
            return(true);
        }