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(); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); var entity = new LLSettingLogic().QueryByID(this.id); this.txtNo.Text = entity.no; this.txtName.Text = entity.name; this.txtPosition.Text = entity.position; this.txtMemo.Text = entity.remark; }