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

            if (this.txtgid.Text.Trim().Length == 0)
            {
                strErr += "gid不能为空!\\n";
            }
            if (this.txtname.Text.Trim().Length == 0)
            {
                strErr += "name不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string gid  = this.txtgid.Text;
            string name = this.txtname.Text;

            ManagePhones.Model.good model = new ManagePhones.Model.good();
            model.gid  = gid;
            model.name = name;

            ManagePhones.BLL.good bll = new ManagePhones.BLL.good();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Ejemplo n.º 2
0
 private void ShowInfo(string gid)
 {
     ManagePhones.BLL.good   bll   = new ManagePhones.BLL.good();
     ManagePhones.Model.good model = bll.GetModel(gid);
     this.lblgid.Text  = model.gid;
     this.lblname.Text = model.name;
 }