Ejemplo n.º 1
0
 private void ShowInfo(int Id)
 {
     OLBookstore.BLL.PublishersManager bll   = new OLBookstore.BLL.PublishersManager();
     OLBookstore.Model.Publishers      model = bll.GetModel(Id);
     this.lblId.Text   = model.Id.ToString();
     this.lblName.Text = model.Name;
 }
Ejemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    Id   = int.Parse(this.lblId.Text);
            string Name = this.lblName.Text;


            OLBookstore.Model.Publishers model = new OLBookstore.Model.Publishers();
            model.Id   = Id;
            model.Name = Name;

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

            if (this.txtName.Text.Trim().Length == 0)
            {
                strErr += "Name不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string Name = this.txtName.Text;

            OLBookstore.Model.Publishers model = new OLBookstore.Model.Publishers();
            model.Name = Name;

            OLBookstore.BLL.PublishersManager bll = new OLBookstore.BLL.PublishersManager();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }