Exemplo 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);
        }
Exemplo 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());
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 5
0
 public void Remove(Models.SysPermission item)
 {
     throw new NotImplementedException();
 }