protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtKeyword.Text.Trim().Length == 0) { strErr += "Keyword不能为空!\\n"; } if (!PageValidate.IsNumber(txtSearchCount.Text)) { strErr += "SearchCount格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string Keyword = this.txtKeyword.Text; int SearchCount = int.Parse(this.txtSearchCount.Text); OLBookstore.Model.SearchKeywords model = new OLBookstore.Model.SearchKeywords(); model.Keyword = Keyword; model.SearchCount = SearchCount; OLBookstore.BLL.SearchKeywordsManager bll = new OLBookstore.BLL.SearchKeywordsManager(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int Id) { OLBookstore.BLL.SearchKeywordsManager bll = new OLBookstore.BLL.SearchKeywordsManager(); OLBookstore.Model.SearchKeywords model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblKeyword.Text = model.Keyword; this.lblSearchCount.Text = model.SearchCount.ToString(); }