Exemple #1
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);
     }
 }
Exemple #2
0
        protected void lbtSave_Click(object sender, EventArgs e)
        {
            RolesOR cg = setValue();
            RolesDA carClassAdin = new RolesDA();
            try
            {
                if (Request.QueryString["opType"] == null)
                {
                    ObservableCollection<RolesOR> dt = carClassAdin.SelectAllRoles();
                    for (int i = 0; i < dt.Count; i++)
                    {
                        if (dt[i].RoleName.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());
                    ObservableCollection<RolesOR> dt = carClassAdin.SelectRolesWithoutSelf(or.RoleName);
                    for (int i = 0; i < dt.Count; i++)
                    {
                        if (dt[i].RoleName.ToLower() == txtName.Text.Trim().ToLower())
                        {
                            Alert("该角色已存在!");
                            return;
                        }
                    }
                    carClassAdin.Update(cg);
                }
                base.Close("OK");
            }
            catch (Exception ex)
            {
                base.Alert(ex.Message);
            }
        }
Exemple #3
0
        /*根据Role.sitemap绑定权限列表*/
        private void InitPage()
        {
            if (null == Request.QueryString["guid"])
            {
                Alert("获取参数错误!");
                return;
            }
            string guid = Request.QueryString["guid"];
            ListPerm = new UserPermissionsDA().SelectFunctionCheckPermInRose(guid);
            //dt.DefaultView.RowFilter = "MOD_LEVEL=1";

            this.rptMenu0.DataSource = ListPerm.Where(a => a.MOD_LEVEL == 1).ToList();
            this.rptMenu0.DataBind();

            RolesOR T_SY = new RolesDA().selectARowDate(guid);
            lblName.Text = T_SY.RoleName;//角色名称
            lblDesc.Text = T_SY.RoleDesc;//角色说明
        }
Exemple #4
0
 private void initRose()
 {
     RolesDA rs = new RolesDA();
     int Count = 0;
     cblRoseList.DataSource = rs.selectAllDateByWhere(1, 50, out Count, ""); ;
     cblRoseList.DataTextField = "RoleName";
     cblRoseList.DataValueField = "Guid";
     cblRoseList.DataBind();
 }