Exemplo n.º 1
0
        public ActionResult <List <Roles> > Get()
        {
            AppDB   db    = provider.GetService <AppDB>();
            RolesDA roles = new RolesDA(db);

            return(roles.getAll());
        }
Exemplo n.º 2
0
        public ActionResult <List <Roles> > Get(int id)
        {
            AppDB   db    = provider.GetRequiredService <AppDB>();
            RolesDA roles = new RolesDA(db);

            return(roles.getById(id));
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        public ActionResult <object> Update(Roles roles)
        {
            AppDB   db      = provider.GetRequiredService <AppDB>();
            RolesDA rolesDA = new RolesDA(db);
            var     res     = rolesDA.update(roles);

            return(new
            {
                result = res
            });
        }
Exemplo n.º 5
0
 public List <cRoles> Listar(Int32 CodigoModulo)
 {
     try
     {
         return(RolesDA.Listar(CodigoModulo));
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
 }
Exemplo n.º 6
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);
     }
 }
Exemplo n.º 7
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);
            }
        }
Exemplo n.º 8
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; //角色说明
        }
Exemplo n.º 9
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();
 }