Esempio n. 1
0
        public void Add(Models.SysPermission item)
        {
            DbCommand comm = this.GetCommand("SysPermission_Insert");

            comm.AddParameter <string>(this.Factory, "Code", item.Code);
            comm.AddParameter <string>(this.Factory, "Name", item.Name);

            this.SafeExecuteNonQuery(comm);
        }
Esempio n. 2
0
        public Models.SysPermission Get(Models.SysPermission dummy)
        {
            DbCommand comm = this.GetCommand("SysPermission_Get");



            comm.AddParameter <string>(this.Factory, "Code", dummy.Code);


            DataTable dt = this.GetTable(comm);

            return(EntityBase.ParseListFromTable <SysPermission>(dt).FirstOrDefault());
        }
Esempio n. 3
0
        public void Update(Models.SysPermission @new, Models.SysPermission old)
        {
            var item = @new;

            item.Code = old.Code;



            DbCommand comm = this.GetCommand("SysPermission_Update");

            comm.AddParameter <string>(this.Factory, "Code", item.Code);
            comm.AddParameter <string>(this.Factory, "Name", item.Name);



            this.SafeExecuteNonQuery(comm);
        }
Esempio n. 4
0
        private EasyuiTreeNode GetChildPermission(Models.SysPermission pm, IEnumerable <Models.SysPermission> ps, int selectedId)
        {
            var list = ps.Where(p => p.ParentId == pm.PermissionId);
            var node = new EasyuiTreeNode()
            {
                id = pm.PermissionId.ToString(), text = pm.MenuLanguageName
            };

            if (pm.PermissionId == selectedId)
            {
                node.selected = true;
            }
            foreach (var permission in list)
            {
                node.children.Add(GetChildPermission(permission, ps, selectedId));
            }
            return(node);
        }
Esempio n. 5
0
 public void Remove(Models.SysPermission item)
 {
     throw new NotImplementedException();
 }