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

            if (this.txtmname.Text.Trim().Length == 0)
            {
                strErr += "mname不能为空!\\n";
            }
            if (this.txtmurl.Text.Trim().Length == 0)
            {
                strErr += "murl不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtmstatus.Text))
            {
                strErr += "mstatus格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string mname   = this.txtmname.Text;
            string murl    = this.txtmurl.Text;
            int    mstatus = int.Parse(this.txtmstatus.Text);

            myhouse.Model.Menus model = new myhouse.Model.Menus();
            model.mname   = mname;
            model.murl    = murl;
            model.mstatus = mstatus;

            myhouse.BLL.MenusService bll = new myhouse.BLL.MenusService();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Esempio n. 2
0
 private void ShowInfo(int mid)
 {
     myhouse.BLL.MenusService bll   = new myhouse.BLL.MenusService();
     myhouse.Model.Menus      model = bll.GetModel(mid);
     this.lblmid.Text     = model.mid.ToString();
     this.lblmname.Text   = model.mname;
     this.lblmurl.Text    = model.murl;
     this.lblmstatus.Text = model.mstatus.ToString();
 }