public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtCommandName.Text.Trim().Length == 0) { strErr += "指令名称不能为空!\\n"; } if (!PageValidate.IsNumber(txtFlag.Text)) { strErr += "Flag格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int CommandID = int.Parse(this.lblCommandID.Text); string CommandName = this.txtCommandName.Text; int Flag = int.Parse(this.txtFlag.Text); WebDemo.Model.WebDemo.CommandType model = new WebDemo.Model.WebDemo.CommandType(); model.CommandID = CommandID; model.CommandName = CommandName; model.Flag = Flag; WebDemo.BLL.WebDemo.CommandType bll = new WebDemo.BLL.WebDemo.CommandType(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int CommandID) { WebDemo.BLL.WebDemo.CommandType bll = new WebDemo.BLL.WebDemo.CommandType(); WebDemo.Model.WebDemo.CommandType model = bll.GetModel(CommandID); this.lblCommandID.Text = model.CommandID.ToString(); this.lblCommandName.Text = model.CommandName; this.lblFlag.Text = model.Flag.ToString(); }