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

            this.txtNo.Text       = entity.no;
            this.txtName.Text     = entity.name;
            this.txtPosition.Text = entity.position;
            this.txtMin.Text      = entity.minTemperature.ToString();
            this.txtMax.Text      = entity.maxTemperature.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;
            }
            TemperatureNo entity = new TemperatureNo();

            entity.no             = this.txtNo.Text.Trim();
            entity.name           = this.txtName.Text.Trim();
            entity.position       = this.txtPosition.Text.Trim();
            entity.inputMan       = this.UserName;
            entity.minTemperature = decimal.Parse(this.txtMin.Text.Trim());
            entity.maxTemperature = decimal.Parse(this.txtMax.Text.Trim());
            entity.remark         = this.txtMemo.Text;
            string strResult = new WDSettingLogic().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();
            }
        }