Ejemplo n.º 1
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet             ds     = common.GetList(" select menuName from tb_sys_sysmenu where menuName='" + this.txtMenuName.Value.Trim() + "' ");

        if (!Tools.Validator.CheckDataSet(ds, 0))
        {
            Test_Model.sys_sysmenu sysmenuModel = new Test_Model.sys_sysmenu();
            sysmenuModel.menuName = this.txtMenuName.Value.Trim();
            string imgUrl = this.txtMenuImg.Value.Trim();
            sysmenuModel.imgUrl    = imgUrl != "" ? imgUrl : "../Images/Ico/null.gif";
            sysmenuModel.menuOrder = Tools.StringHelp.GetInt(this.txtIntOrder.Value.Trim());
            sysmenuModel.addName   = adminGetCount;
            sysmenuModel.addTime   = DateTime.Now;

            Test_BUL.sys_sysmenu sysmenu = new Test_BUL.sys_sysmenu();
            if (sysmenu.Add(sysmenuModel) > 0)
            {
                Response.Redirect("Manage_Menu.aspx");
            }
            else
            {
                FinalMessage("新增用户失败!", "Add_Menu.aspx", 1);
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (string.IsNullOrEmpty(q("menuId")))
                FinalMessage("网络错误!", "Manage_Menu.aspx", 1);

            sysmenuModel = sysmenu.GetModel(Tools.StringHelp.GetInt(q("menuId")));
            this.txtMenuName.Value = sysmenuModel.menuName;
            this.txtMenuImg.Value = sysmenuModel.imgUrl;
            NowImgPath = sysmenuModel.imgUrl;
            this.txtIntOrder.Value = sysmenuModel.menuOrder.ToString();
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (string.IsNullOrEmpty(q("menuId")))
            {
                FinalMessage("网络错误!", "Manage_Menu.aspx", 1);
            }

            sysmenuModel           = sysmenu.GetModel(Tools.StringHelp.GetInt(q("menuId")));
            this.txtMenuName.Value = sysmenuModel.menuName;
            this.txtMenuImg.Value  = sysmenuModel.imgUrl;
            NowImgPath             = sysmenuModel.imgUrl;
            this.txtIntOrder.Value = sysmenuModel.menuOrder.ToString();
        }
    }
Ejemplo n.º 4
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet ds = common.GetList(" select menuName from tb_sys_sysmenu where menuName='" + this.txtMenuName.Value.Trim() + "' ");
        if (!Tools.Validator.CheckDataSet(ds, 0))
        {
            Test_Model.sys_sysmenu sysmenuModel = new Test_Model.sys_sysmenu();
            sysmenuModel.menuName = this.txtMenuName.Value.Trim();
            string imgUrl = this.txtMenuImg.Value.Trim();
            sysmenuModel.imgUrl = imgUrl != "" ? imgUrl : "../Images/Ico/null.gif";
            sysmenuModel.menuOrder = Tools.StringHelp.GetInt(this.txtIntOrder.Value.Trim());
            sysmenuModel.addName = adminGetCount;
            sysmenuModel.addTime = DateTime.Now;

            Test_BUL.sys_sysmenu sysmenu = new Test_BUL.sys_sysmenu();
            if (sysmenu.Add(sysmenuModel) > 0)
                Response.Redirect("Manage_Menu.aspx");
            else
                FinalMessage("新增用户失败!", "Add_Menu.aspx", 1);
        }
    }