示例#1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtF_Name.Text.Trim().Length == 0)
            {
                strErr += "菜单名称不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtF_ParentID.Text))
            {
                strErr += "父编号格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string F_Name     = this.txtF_Name.Text;
            int    F_ParentID = int.Parse(this.txtF_ParentID.Text);
            bool   F_IsUsed   = this.chkF_IsUsed.Checked;

            WSS.Model.Menus model = new WSS.Model.Menus();
            model.F_Name     = F_Name;
            model.F_ParentID = F_ParentID;
            model.F_IsUsed   = F_IsUsed;

            WSS.BLL.Menus bll = new WSS.BLL.Menus();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
示例#2
0
 private void ShowInfo(int F_MenuID)
 {
     WSS.BLL.Menus   bll   = new WSS.BLL.Menus();
     WSS.Model.Menus model = bll.GetModel(F_MenuID);
     this.lblF_MenuID.Text   = model.F_MenuID.ToString();
     this.lblF_Name.Text     = model.F_Name;
     this.lblF_ParentID.Text = model.F_ParentID.ToString();
     this.lblF_IsUsed.Text   = model.F_IsUsed?"ÊÇ":"·ñ";
 }
 private void ShowInfo(int F_MenuID)
 {
     WSS.BLL.Menus   bll   = new WSS.BLL.Menus();
     WSS.Model.Menus model = bll.GetModel(F_MenuID);
     this.lblF_MenuID.Text    = model.F_MenuID.ToString();
     this.txtF_Name.Text      = model.F_Name;
     this.txtF_ParentID.Text  = model.F_ParentID.ToString();
     this.chkF_IsUsed.Checked = model.F_IsUsed;
 }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         WSS.BLL.Menus bll = new WSS.BLL.Menus();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int F_MenuID = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(F_MenuID);
             Response.Redirect("list.aspx");
         }
     }
 }