Example #1
0
 private void initRose()
 {
     RolesDA rs = new RolesDA();
     int Count = 0;
     DataTable listRose = rs.selectAllDateByWhere(1, 50, out Count, "");
     cblRoseList.DataSource = listRose;
     cblRoseList.DataTextField = "ROLE_NAME";
     cblRoseList.DataValueField = "GUID";
     cblRoseList.DataBind();
 }
Example #2
0
        protected void lbtSave_Click(object sender, EventArgs e)
        {
            RolesOR cg = setValue();
            RolesDA carClassAdin = new RolesDA();

            try
            {
                if (Request.QueryString["opType"] == null)
                {
                    DataTable dt = carClassAdin.SelectAllRoles();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["Role_Name"].ToString().Trim().ToLower() == txtName.Text.Trim().ToLower())
                        {
                            Alert("该角色已存在!");
                            return;
                        }
                    }
                        carClassAdin.Insert(cg);

                }
                else if (Request.QueryString["opType"].ToString() == "alert")
                {
                    RolesOR or = new RolesDA().selectARowDate(Request["id"].ToString());
                    DataTable dt = carClassAdin.SelectRolesWithoutSelf(or.RoleName);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["Role_Name"].ToString().Trim().ToLower() == txtName.Text.Trim().ToLower())
                        {
                            Alert("该角色已存在!");
                            return;
                        }
                    }
                        carClassAdin.Update(cg);

                }
                base.Close(true);
            }
            catch (Exception ex)
            {
                base.Alert(ex.Message);
            }
        }
Example #3
0
        /*根据Role.sitemap绑定权限列表*/
        private void InitPage()
        {
            if (null == Request.QueryString["guid"])
            {
                Alert("获取参数错误!");
                return;
            }
            string guid = Request.QueryString["guid"];
            dt = new FunctionDA().selectAllDate(guid);
            dt.DefaultView.RowFilter = "MOD_LEVEL=1";
            this.rptMenu0.DataSource = dt.DefaultView;
            this.rptMenu0.DataBind();

            RolesOR T_SY = new RolesDA().selectARowDate(guid);
            lblName.Text = T_SY.RoleName;//角色名称
            lblDesc.Text = T_SY.RoleDesc;//角色说明
        }
Example #4
0
 private void loadData()
 {
     try
     {
         if (Request.QueryString["id"] != null)
         {
             string id = Request.QueryString["id"].ToString();
             RolesOR T_SY = new RolesDA().selectARowDate(id);
             txtName.Text = T_SY.RoleName;//角色名称
             txtROLE_DESC.Text = T_SY.RoleDesc;//角色说明
         }
     }
     catch (Exception e)
     {
         Alert(e);
     }
 }