Beispiel #1
0
    /// <summary>
    /// 绑定父级模块的下拉列表
    /// </summary>
    private void BindDDL()
    {
        DataSet ds = common.GetList(" select id, menuName from tb_sys_sysmenu ");

        Tools.WebControl.BindList(this.ddlParentMD, ds.Tables[0], "menuName", "Id");
        this.ddlParentMD.Items.Insert(0, new ListItem("——请选中——", "-1"));
    }
Beispiel #2
0
    /// <summary>
    /// 获得所有大类菜单
    /// </summary>
    private void DataBind_CheckBoxList()
    {
        DataTable dt = common.GetList("select id,menuName from tb_sys_sysmenu").Tables[0];

        rpt_RoleList.DataSource = dt.DefaultView;
        rpt_RoleList.DataBind();
    }
Beispiel #3
0
    private void BindProvince()
    {
        string  strb = " select CapitalName,DomainID from tb_sys_capital ";
        DataSet ds   = common.GetList(strb.ToString());

        Tools.WebControl.BindList(this.ddlProcince, ds.Tables[0], "CapitalName", "DomainID");
        this.ddlProcince.Items.Insert(0, new ListItem("——请选中——", "-1"));
    }
Beispiel #4
0
    /// <summary>
    /// 绑定角色类型
    /// </summary>
    private void BindRole()
    {
        System.Text.StringBuilder strb = new System.Text.StringBuilder(" select id,roleName FROM tb_sys_role ");
        if (adminGetadminTag != Test_BUL.sysParam.AdministratorTagH)
        {
            strb.Append(" where roleName!='超级管理员' ");
        }

        DataSet ds = common.GetList(strb.ToString());

        Tools.WebControl.BindList(this.ddlRole, ds.Tables[0], "roleName", "id");
        this.ddlRole.Items.Insert(0, new ListItem("——请选中——", "-1"));
    }
Beispiel #5
0
        /// <summary>
        /// 加载用户菜单
        /// </summary>
        /// <param name="ds">系统所有菜单</param>
        /// <param name="FileItems">用户权限页面id集合</param>
        /// <returns></returns>
        public string GetSystemMenu(DataSet ds, string FileItems)
        {
            if (ds == null || string.IsNullOrEmpty(FileItems))
            {
                return("");
            }

            StringBuilder strbu     = new StringBuilder("");
            int           tempCount = ds.Tables[0].Rows.Count;

            for (int i = 0; i < tempCount; i++)
            {
                Test_BUL.sys_Common common      = new sys_Common();
                DataSet             tempChildDs = common.GetList(" select * from tb_sys_sysfiles where id in(" + FileItems + ") and showLeft=1 and ClassId=" + ds.Tables[0].Rows[i]["id"].ToString());
                if (sysCheck.CheckDataSet(tempChildDs, 0))
                {
                    strbu.Append(" <dl> ");//start nod
                    strbu.Append(" <dt><span style=\"background-image: url("
                                 + ds.Tables[0].Rows[i]["imgUrl"].ToString() + ");\">"
                                 + ds.Tables[0].Rows[i]["menuName"].ToString() + "</span></dt> ");
                    strbu.Append(" <dd class=\"hide\"><ul> ");
                    for (int j = 0; j < tempChildDs.Tables[0].Rows.Count; j++)//add Child Node
                    {
                        strbu.Append(" <li><a href=\"./" + tempChildDs.Tables[0].Rows[j]["filesUrl"].ToString()
                                     + "\" target=\"main_iframe\" >" + tempChildDs.Tables[0].Rows[j]["fielsName"].ToString() + "</a></li> ");
                    }
                    strbu.Append(" </ul></dd> ");
                    strbu.Append(" </dl> ");//end nod
                }
            }
            return(strbu.ToString());
        }
Beispiel #6
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);
            }
        }
    }
Beispiel #7
0
        /// <summary>
        /// 加载用户菜单
        /// </summary>
        /// <param name="ds">系统所有菜单</param>
        /// <param name="FileItems">用户权限页面id集合</param>
        /// <returns></returns>
        public string GetSystemMenu(DataSet ds, string FileItems)
        {
            if (ds == null || string.IsNullOrEmpty(FileItems))
                return "";

            StringBuilder strbu = new StringBuilder("");
            int tempCount = ds.Tables[0].Rows.Count;
            for (int i = 0; i < tempCount; i++)
            {
                Test_BUL.sys_Common common = new sys_Common();
                DataSet tempChildDs = common.GetList(" select * from tb_sys_sysfiles where id in(" + FileItems + ") and showLeft=1 and ClassId=" + ds.Tables[0].Rows[i]["id"].ToString());
                if (sysCheck.CheckDataSet(tempChildDs, 0))
                {
                    strbu.Append(" <dl> ");//start nod
                    strbu.Append(" <dt><span style=\"background-image: url("
                        + ds.Tables[0].Rows[i]["imgUrl"].ToString() + ");\">"
                        + ds.Tables[0].Rows[i]["menuName"].ToString() + "</span></dt> ");
                    strbu.Append(" <dd class=\"hide\"><ul> ");
                    for (int j = 0; j < tempChildDs.Tables[0].Rows.Count; j++)//add Child Node
                    {
                        strbu.Append(" <li><a href=\"./" + tempChildDs.Tables[0].Rows[j]["filesUrl"].ToString()
                            + "\" target=\"main_iframe\" >" + tempChildDs.Tables[0].Rows[j]["fielsName"].ToString() + "</a></li> ");
                    }
                    strbu.Append(" </ul></dd> ");
                    strbu.Append(" </dl> ");//end nod
                }
            }
            return strbu.ToString();
        }
Beispiel #8
0
 private void BindProvince()
 {
     Test_BUL.sys_Common common = new Test_BUL.sys_Common();
     string strb = " select CapitalName,DomainID from tb_sys_capital ";
     DataSet ds = common.GetList(strb.ToString());
     Tools.WebControl.BindList(this.ddlProcince, ds.Tables[0], "CapitalName", "DomainID");
     this.ddlProcince.Items.Insert(0, new ListItem("——请选中——", "-1"));
 }
Beispiel #9
0
    /// <summary>
    /// 绑定城市
    /// </summary>
    private void BindProvince()
    {
        DataSet ds;

        if (Tools.CacheUtil.IsExist(Test_BUL.sysParam.CacheCapital_info))
        {
            ds = (DataSet)Tools.CacheUtil.GetCache(Test_BUL.sysParam.CacheCapital_info);
        }
        else
        {
            string strb = " select CapitalName,DomainID from tb_sys_capital ";
            ds = common.GetList(strb.ToString());
            Tools.CacheUtil.InsertCach(Test_BUL.sysParam.CacheCapital_info, (object)ds, 60 * 60, 2);
        }
        Tools.WebControl.BindList(this.ddlProcince, ds.Tables[0], "CapitalName", "DomainID");
        this.ddlProcince.Items.Insert(0, new ListItem("——请选中——", "-1"));
    }
Beispiel #10
0
    /// <summary>
    /// 更新数据
    /// </summary>
    protected void btnCon_Click(object sender, EventArgs e)
    {
        string _name    = this.txtName.Value.Trim();
        string _value   = this.txtValue.Value.Trim();
        string _typetag = this.txtTypeTag.Value.Trim();

        if (string.IsNullOrEmpty(_name) || string.IsNullOrEmpty(_typetag))
        {
            FinalMessage("请确认所填信息的完整性", "Add_SysParam.aspx", 1);
        }
        if (Tools.RequestCheck.CheckKeyWord(_name) || Tools.RequestCheck.CheckKeyWord(_typetag))
        {
            FinalMessage("参数名或类型标记含有非法字符", "Add_SysParam.aspx", 1);
        }
        if (!Tools.Validator.IsPositiveInt(_value))
        {
            FinalMessage("参数值应为正整数", "Add_SysParam.aspx", 1);
        }

        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet             temds  = common.GetList(" select id, name from tb_sys_paramcenter where name='" + (this.txtName.Value) + "' and typeTag='" + (this.txtTypeTag.Value) + "' ");

        if (Tools.Validator.CheckDataSet(temds, 0))
        {
            if (temds.Tables[0].Rows.Count > 1)
            {
                FinalMessage("此参数名已经存在", "Add_SysParam.aspx", 1);
            }
            else if (temds.Tables[0].Rows[0]["id"].ToString() != ID)
            {
                FinalMessage("此参数名已经存在", "Add_SysParam.aspx", 1);
            }
        }

        modelparma.id          = Tools.StringHelp.GetInt(ID);
        modelparma.name        = _name;
        modelparma.value       = Tools.StringHelp.GetInt(_value);
        modelparma.typeTag     = Tools.StringHelp.CutStirngNormal(_typetag, 10, 0);
        modelparma.addUserId   = Tools.StringHelp.GetInt(adminGetId);
        modelparma.addUserName = adminGetCount;
        modelparma.addTime     = DateTime.Now;

        if (bulparam.Update(modelparma))
        {
            Response.Redirect("Manage_SysParam.aspx?p=" + p);
        }
        else
        {
            FinalMessage("保存失败", "Add_SysParam.aspx", 1);
        }
    }
Beispiel #11
0
    /// <summary>
    /// 获取菜单HTML
    /// </summary>
    private void LoadMenu()
    {
        //重新获取用户权限页面id集合,并写入缓存
        DataSet SysAdminDS = common.GetList(" select pageId from tb_sys_role where id=" + adminGetRoleId);

        Tools.CacheUtil.InsertCach(Test_BUL.sysParam.CachePageIdDs, (object)SysAdminDS, Test_BUL.sysParam.CachePageIdDsTimes, 2);

        string FileItems = SysAdminDS.Tables[0].Rows[0]["pageId"].ToString();//1,2,3,4,5,6,7,8,9...

        if (string.IsNullOrEmpty(FileItems))
        {
            return;
        }

        //获取所有系统菜单
        DataSet ds = common.GetList(" select id,menuName,imgUrl from tb_sys_sysmenu order by menuOrder asc ");

        if (Tools.Validator.CheckDataSet(ds, 0))
        {
            Test_BUL.sys_sysmenu bulMenu = new Test_BUL.sys_sysmenu();
            _response = bulMenu.GetSystemMenu(ds, FileItems);
        }
    }
Beispiel #12
0
    /// <summary>
    /// 获取菜单HTML 
    /// </summary>
    /// <returns></returns>
    private string GetMenuHTML()
    {
        if (string.IsNullOrEmpty(FileItems))
            return "";

        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet ds = common.GetList(" select id,menuName,imgUrl from tb_sys_sysmenu order by menuOrder asc ");
        if (Tools.Validator.CheckDataSet(ds, 0))
        {
            Test_BUL.sys_sysmenu bulMenu = new Test_BUL.sys_sysmenu();           
            return bulMenu.GetSystemMenu(ds, FileItems);
        }
        return "";
    }
Beispiel #13
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        if (!Tools.Validator.IsPositiveInt(q("menuId")) || Tools.RequestCheck.CheckKeyWord(q("menuId")))
        {
            FinalMessage("UTL解析错误,请勿在Url中添加非法关键词!", "Manage_Menu.aspx", 1);
        }

        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;
        sysmenuModel.id        = int.Parse(q("menuId"));

        DataSet ds = common.GetList(" select id, menuName from tb_sys_sysmenu where menuName='" + this.txtMenuName.Value.Trim() + "' ");

        if (!Tools.Validator.CheckDataSet(ds, 0))
        {
            if (sysmenu.Update(sysmenuModel))
            {
                Response.Redirect("Manage_Menu.aspx");
            }
            else
            {
                FinalMessage("保存失败!", "Manage_Menu.aspx", 1);
            }
        }
        else
        {
            if (ds.Tables[0].Rows[0]["id"].ToString() == q("menuId"))
            {
                if (sysmenu.Update(sysmenuModel))
                {
                    Response.Redirect("Manage_Menu.aspx");
                }
                else
                {
                    FinalMessage("保存失败!", "Manage_Menu.aspx", 1);
                }
            }
            else
            {
                FinalMessage("此菜单模块已经存在!", "Manage_Menu.aspx", 1);
            }
        }
    }
Beispiel #14
0
    /// <summary>
    /// 数据绑定
    /// </summary>
    private void DataBind_role()
    {
        DataSet ds = common.GetList(" select id,roleName,addUser,addTime FROM tb_sys_role ");

        if (Tools.Validator.CheckDataSet(ds, 0))
        {
            ds.Tables[0].Columns.Add("number");
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ds.Tables[0].Rows[i]["number"] = (i + 1).ToString();
            }

            this.rpt_roleList.DataSource = ds.Tables[0].DefaultView;
            this.rpt_roleList.DataBind();
        }
    }
Beispiel #15
0
    /// <summary>
    /// 获取菜单HTML
    /// </summary>
    /// <returns></returns>
    private string GetMenuHTML()
    {
        if (string.IsNullOrEmpty(FileItems))
        {
            return("");
        }

        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet             ds     = common.GetList(" select id,menuName,imgUrl from tb_sys_sysmenu order by menuOrder asc ");

        if (Tools.Validator.CheckDataSet(ds, 0))
        {
            Test_BUL.sys_sysmenu bulMenu = new Test_BUL.sys_sysmenu();
            return(bulMenu.GetSystemMenu(ds, FileItems));
        }
        return("");
    }
Beispiel #16
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);
        }
    }
Beispiel #17
0
    /// <summary>
    /// 更新数据
    /// </summary>
    protected void btnCon_Click(object sender, EventArgs e)
    {
        string _name = this.txtName.Value.Trim();
        string _value = this.txtValue.Value.Trim();
        string _typetag = this.txtTypeTag.Value.Trim();

        if (string.IsNullOrEmpty(_name) || string.IsNullOrEmpty(_typetag))
            FinalMessage("请确认所填信息的完整性", "Add_SysParam.aspx", 1);
        if (Tools.RequestCheck.CheckKeyWord(_name) || Tools.RequestCheck.CheckKeyWord(_typetag))
            FinalMessage("参数名或类型标记含有非法字符", "Add_SysParam.aspx", 1);
        if (!Tools.Validator.IsPositiveInt(_value))
            FinalMessage("参数值应为正整数", "Add_SysParam.aspx", 1);

        Test_BUL.sys_Common common = new Test_BUL.sys_Common();
        DataSet temds = common.GetList(" select id, name from tb_sys_paramcenter where name='" + (this.txtName.Value) + "' and typeTag='" + (this.txtTypeTag.Value) + "' ");
        if (Tools.Validator.CheckDataSet(temds, 0))
        {
            if (temds.Tables[0].Rows.Count > 1)
                FinalMessage("此参数名已经存在", "Add_SysParam.aspx", 1);
            else if (temds.Tables[0].Rows[0]["id"].ToString() != ID)
                FinalMessage("此参数名已经存在", "Add_SysParam.aspx", 1);
        }

        modelparma.id = Tools.StringHelp.GetInt(ID);
        modelparma.name = _name;
        modelparma.value = Tools.StringHelp.GetInt(_value);
        modelparma.typeTag = Tools.StringHelp.CutStirngNormal(_typetag, 10, 0);
        modelparma.addUserId = Tools.StringHelp.GetInt(adminGetId);
        modelparma.addUserName = adminGetCount;
        modelparma.addTime = DateTime.Now;

        if (bulparam.Update(modelparma))
            Response.Redirect("Manage_SysParam.aspx?p=" + p);
        else
            FinalMessage("保存失败", "Add_SysParam.aspx", 1);
    }
Beispiel #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (CheckAdminLogin())
        {
            return;//已经登录过了
        }
        string validate = StringHelp.FilterSymbolStr(q("validate"));

        if (string.IsNullOrEmpty(validate))
        {
            return;                                                           //参数丢失;
        }
        if (string.Compare(validate, Session["LVNum"].ToString(), true) == 0) //不区分大小写比较验证码
        {
            string count = q("paramName");
            string pwd   = q("paramPwd");

            if (string.IsNullOrEmpty(count) || string.IsNullOrEmpty(pwd))
            {
                Response.Write("1|" + Test_BUL.sysParam.ErrorPageTip("1"));
            }
            if (RequestCheck.CheckKeyWord(count) || RequestCheck.CheckKeyWord(pwd))
            {
                Response.Write("3|" + Test_BUL.sysParam.ErrorPageTip("3"));
            }
            else
            {
                string  strsql = common.GetCustomDSsql("tb_sys_admin", "id,count,password,loginIP,loginTime,telephone,email,sex,birthday,createTime,roleid,adminTag,AccountState,PowerLeave ", " count='" + count + "' ");
                DataSet ds     = common.GetList(strsql);
                if (Tools.Validator.CheckDataSet(ds, 0))
                {
                    if (ds.Tables[0].Rows[0]["password"].ToString() == EncryptAdmin(pwd))
                    {
                        string state = ds.Tables[0].Rows[0]["AccountState"].ToString();
                        //账号状态:10正常,20冻结,30禁用
                        if (state == "20")
                        {
                            Response.Write("20|" + Test_BUL.sysParam.ErrorPageTip("11"));
                        }
                        else if (state == "30")
                        {
                            Response.Write("30|" + Test_BUL.sysParam.ErrorPageTip("12"));
                        }
                        else
                        {
                            string tempRoleId   = ds.Tables[0].Rows[0]["roleid"].ToString();
                            string tempAdminTag = ds.Tables[0].Rows[0]["adminTag"].ToString();

                            if (string.IsNullOrEmpty(tempRoleId) || state != "10" || string.IsNullOrEmpty(tempAdminTag))
                            {
                                Response.Write("14|" + Test_BUL.sysParam.ErrorPageTip("14"));
                            }
                            else
                            {
                                SetUserCookie(ds.Tables[0]);                            //用户信息写入Cookies
                                Test_BUL.sys_admin blladmin = new Test_BUL.sys_admin(); //更新登录IP和登录时间
                                blladmin.UpdateLogin(count, Tools.IPHelp.ClientIP, DateTime.Now);
                                Response.Write("10|" + Test_BUL.sysParam.ErrorPageTip("10"));
                            }
                        }
                    }
                    else
                    {
                        Response.Write("9|" + Test_BUL.sysParam.ErrorPageTip("9"));
                    }
                }
                else
                {
                    Response.Write("8|" + Test_BUL.sysParam.ErrorPageTip("8"));
                }
            }
        }
        else
        {
            Response.Write("15|" + Test_BUL.sysParam.ErrorPageTip("15"));
        }
    }