Ejemplo n.º 1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtSearchTimes.Text))
            {
                strErr += "SearchTimes格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            Guid   Id          = new Guid(this.lblId.Text);
            string KeyWords    = this.lblKeyWords.Text;
            int    SearchTimes = int.Parse(this.txtSearchTimes.Text);


            BookShop.Model.keyWordsRank model = new BookShop.Model.keyWordsRank();
            model.Id          = Id;
            model.KeyWords    = KeyWords;
            model.SearchTimes = SearchTimes;

            BookShop.BLL.keyWordsRank bll = new BookShop.BLL.keyWordsRank();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtKeyWords.Text.Trim().Length == 0)
            {
                strErr += "KeyWords不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtSearchTimes.Text))
            {
                strErr += "SearchTimes格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string KeyWords    = this.txtKeyWords.Text;
            int    SearchTimes = int.Parse(this.txtSearchTimes.Text);

            BookShop.Model.keyWordsRank model = new BookShop.Model.keyWordsRank();
            model.KeyWords    = KeyWords;
            model.SearchTimes = SearchTimes;

            BookShop.BLL.keyWordsRank bll = new BookShop.BLL.keyWordsRank();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Ejemplo n.º 3
0
 private void ShowInfo(Guid Id, string KeyWords)
 {
     BookShop.BLL.keyWordsRank   bll   = new BookShop.BLL.keyWordsRank();
     BookShop.Model.keyWordsRank model = bll.GetModel(Id, KeyWords);
     this.lblId.Text          = model.Id.ToString();
     this.lblKeyWords.Text    = model.KeyWords;
     this.txtSearchTimes.Text = model.SearchTimes.ToString();
 }