Esempio n. 1
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;
            }
            FlowmeterNo entity = new FlowmeterNo();

            entity.no       = this.txtNo.Text.Trim();
            entity.name     = this.txtName.Text.Trim();
            entity.position = this.txtPosition.Text.Trim();
            entity.inputMan = this.UserName;
            entity.remark   = this.txtMemo.Text;
            string strResult = new LLSettingLogic().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.txtMemo.Text     = "";
                this.BindList();
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 添加设置
 /// </summary>
 /// <param name="entity"></param>
 public void Insert(FlowmeterNo entity)
 {
     using (MonitorDataContext oContext = new MonitorDataContext(this._strConn))
     {
         entity.inputDate = DateTime.Now;
         oContext.FlowmeterNo.InsertOnSubmit(entity);
         oContext.SubmitChanges();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 更新流量计设置
 /// </summary>
 /// <param name="entity"></param>
 public void Update(FlowmeterNo entity)
 {
     using (MonitorDataContext oContext = new MonitorDataContext(new DasherStation.common.SqlHelper().SqlConn))
     {
         var _entity = (from item in oContext.FlowmeterNo
                        where entity.id == item.id
                        select item).FirstOrDefault();
         _entity.name     = entity.name;
         _entity.position = entity.position;
         _entity.remark   = entity.remark;
         oContext.SubmitChanges();
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 添加流量计设置
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public string Add(FlowmeterNo entity)
 {
     if (oData.IsExistByNo(entity.no))
     {
         return("编号已经存在!");
     }
     if (oData.IsExistByName(entity.name))
     {
         return("名称已经存在!");
     }
     oData.Insert(entity);
     return(null);
 }
Esempio n. 5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.txtName.Text.Trim() == "")
            {
                DasherStation.HumanResource.CommUI.AlertError("流量名称不能为空!");
                this.DialogResult = DialogResult.None;
                return;
            }
            FlowmeterNo entity = new FlowmeterNo();

            entity.id       = this.id;
            entity.no       = this.txtNo.Text.Trim();
            entity.name     = this.txtName.Text.Trim();
            entity.position = this.txtPosition.Text.Trim();
            entity.inputMan = this.UserName;
            entity.remark   = this.txtMemo.Text;
            new LLSettingLogic().Update(entity);
            DasherStation.HumanResource.CommUI.MsgOK();
        }
Esempio n. 6
0
 partial void DeleteFlowmeterNo(FlowmeterNo instance);
Esempio n. 7
0
 partial void UpdateFlowmeterNo(FlowmeterNo instance);
Esempio n. 8
0
 partial void InsertFlowmeterNo(FlowmeterNo instance);