protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txttypeName.Text.Trim().Length == 0) { strErr += "typeName不能为空!\\n"; } if (!PageValidate.IsNumber(txtbrDays.Text)) { strErr += "brDays格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string typeName = this.txttypeName.Text; int brDays = int.Parse(this.txtbrDays.Text); YueDuLibrary.Model.BookType model = new YueDuLibrary.Model.BookType(); model.typeName = typeName; model.brDays = brDays; YueDuLibrary.BLL.BookType bll = new YueDuLibrary.BLL.BookType(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int typeId) { YueDuLibrary.BLL.BookType bll = new YueDuLibrary.BLL.BookType(); YueDuLibrary.Model.BookType model = bll.GetModel(typeId); this.lbltypeId.Text = model.typeId.ToString(); this.lbltypeName.Text = model.typeName; this.lblbrDays.Text = model.brDays.ToString(); }