Exemple #1
0
 /// <summary>
 /// 插入液位仪信息
 /// </summary>
 /// <param name="entity"></param>
 public void Insert(LiquidPositionNo entity)
 {
     using (MonitorDataContext oContext = new MonitorDataContext(this._strConn))
     {
         entity.inputDate = DateTime.Now;
         oContext.LiquidPositionNo.InsertOnSubmit(entity);
         oContext.SubmitChanges();
     }
 }
Exemple #2
0
 /// <summary>
 /// 增加液位设置
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public string Add(LiquidPositionNo entity)
 {
     if (oData.IsExistByNo(entity.no))
     {
         return("编号已经存在!");
     }
     if (oData.IsExistByName(entity.name))
     {
         return("名称已经存在!");
     }
     oData.Insert(entity);
     return(null);
 }
Exemple #3
0
 /// <summary>
 /// 更新液位仪信息
 /// </summary>
 /// <param name="entity"></param>
 public void Update(LiquidPositionNo entity)
 {
     using (MonitorDataContext oContext = new MonitorDataContext(this._strConn))
     {
         var _entity = (from item in oContext.LiquidPositionNo
                        where entity.id == item.id
                        select item).FirstOrDefault();
         _entity.name     = entity.name;
         _entity.minValue = entity.minValue;
         _entity.maxValue = entity.maxValue;
         _entity.position = entity.position;
         _entity.remark   = entity.remark;
         oContext.SubmitChanges();
     }
 }
Exemple #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.txtMin.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("最小液位值不能为空!");
                this.DialogResult = DialogResult.None;
                return;
            }
            if (this.txtMax.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("最大液位值不能为空!");
                this.DialogResult = DialogResult.None;
                return;
            }
            decimal tem;

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

            entity.id       = this.ID;
            entity.name     = this.txtName.Text.Trim();
            entity.position = this.txtPosition.Text.Trim();
            entity.minValue = decimal.Parse(this.txtMin.Text.Trim());
            entity.maxValue = decimal.Parse(this.txtMax.Text.Trim());
            entity.remark   = this.txtMemo.Text;
            new YWSettingLogic().Edit(entity);
        }
Exemple #5
0
 /// <summary>
 /// 编辑液位设置
 /// </summary>
 /// <param name="entity"></param>
 public void Edit(LiquidPositionNo entity)
 {
     oData.Update(entity);
 }
Exemple #6
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();
            }
        }
Exemple #7
0
 partial void DeleteLiquidPositionNo(LiquidPositionNo instance);
Exemple #8
0
 partial void UpdateLiquidPositionNo(LiquidPositionNo instance);
Exemple #9
0
 partial void InsertLiquidPositionNo(LiquidPositionNo instance);