Exemple #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            var entity = new YWSettingLogic().GetByID((long)this.ID);

            this.txtNo.Text       = entity.no;
            this.txtName.Text     = entity.name;
            this.txtPosition.Text = entity.position;
            this.txtMin.Text      = entity.minValue.ToString();
            this.txtMax.Text      = entity.maxValue.ToString();
            this.txtMemo.Text     = entity.remark;
        }
Exemple #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.txtNo.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("编码不能为空!");
                return;
            }
            if (this.txtName.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("名称不能为空!");
                return;
            }
            if (this.txtPosition.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("存放位置不能为空!");
                return;
            }
            if (this.txtMin.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("最小液位值不能为空!");
                return;
            }
            if (this.txtMax.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("最大液位值不能为空!");
                return;
            }
            decimal tem;

            if (decimal.TryParse(this.txtMin.Text.Trim(), out tem) == false)
            {
                DasherStation.HumanResource.CommUI.AlertError("最小液位值不是有效数值!");
                return;
            }
            if (decimal.TryParse(this.txtMax.Text.Trim(), out tem) == false)
            {
                DasherStation.HumanResource.CommUI.AlertError("最大液位值不是有效数值!");
                return;
            }
            LiquidPositionNo entity = new LiquidPositionNo();

            entity.no       = this.txtNo.Text.Trim();
            entity.name     = this.txtName.Text.Trim();
            entity.position = this.txtPosition.Text.Trim();
            entity.inputMan = this.UserName;
            entity.minValue = decimal.Parse(this.txtMin.Text.Trim());
            entity.maxValue = decimal.Parse(this.txtMax.Text.Trim());
            entity.remark   = this.txtMemo.Text;
            string strResult = new YWSettingLogic().Add(entity);

            if (string.IsNullOrEmpty(strResult) == false)
            {
                DasherStation.HumanResource.CommUI.AlertError(strResult);
            }
            else
            {
                DasherStation.HumanResource.CommUI.MsgOK();
                this.txtNo.Text       = "";
                this.txtName.Text     = "";
                this.txtPosition.Text = "";
                this.txtMin.Text      = "";
                this.txtMax.Text      = "";
                this.txtMemo.Text     = "";
                this.BindList();
            }
        }