private void ShowInfo(int StateCode) { WebDemo.BLL.WebDemo.MeterStateDictionary bll = new WebDemo.BLL.WebDemo.MeterStateDictionary(); WebDemo.Model.WebDemo.MeterStateDictionary model = bll.GetModel(StateCode); this.lblStateCode.Text = model.StateCode.ToString(); this.lblStateName.Text = model.StateName; this.lblEnable.Text = model.Enable?"是":"否"; this.lblIsShow.Text = model.IsShow?"是":"否"; this.lblOrderNum.Text = model.OrderNum.ToString(); this.lblReasion.Text = model.Reasion; this.lblOperation.Text = model.Operation; }
private void ShowInfo(int StateCode) { WebDemo.BLL.WebDemo.MeterStateDictionary bll = new WebDemo.BLL.WebDemo.MeterStateDictionary(); WebDemo.Model.WebDemo.MeterStateDictionary model = bll.GetModel(StateCode); this.lblStateCode.Text = model.StateCode.ToString(); this.txtStateName.Text = model.StateName; this.chkEnable.Checked = model.Enable; this.chkIsShow.Checked = model.IsShow; this.txtOrderNum.Text = model.OrderNum.ToString(); this.txtReasion.Text = model.Reasion; this.txtOperation.Text = model.Operation; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtStateCode.Text)) { strErr += "StateCode格式错误!\\n"; } if (this.txtStateName.Text.Trim().Length == 0) { strErr += "StateName不能为空!\\n"; } if (!PageValidate.IsNumber(txtOrderNum.Text)) { strErr += "OrderNum格式错误!\\n"; } if (this.txtReasion.Text.Trim().Length == 0) { strErr += "Reasion不能为空!\\n"; } if (this.txtOperation.Text.Trim().Length == 0) { strErr += "Operation不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int StateCode = int.Parse(this.txtStateCode.Text); string StateName = this.txtStateName.Text; bool Enable = this.chkEnable.Checked; bool IsShow = this.chkIsShow.Checked; int OrderNum = int.Parse(this.txtOrderNum.Text); string Reasion = this.txtReasion.Text; string Operation = this.txtOperation.Text; WebDemo.Model.WebDemo.MeterStateDictionary model = new WebDemo.Model.WebDemo.MeterStateDictionary(); model.StateCode = StateCode; model.StateName = StateName; model.Enable = Enable; model.IsShow = IsShow; model.OrderNum = OrderNum; model.Reasion = Reasion; model.Operation = Operation; WebDemo.BLL.WebDemo.MeterStateDictionary bll = new WebDemo.BLL.WebDemo.MeterStateDictionary(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }