Beispiel #1
0
        public static WFRole GetRole(string roleName)
        {
            IWFAdminService svc  = Common.GetAdminAPI();
            WFRole          role = null;

            try
            {
                role = svc.GetRole(roleName);
            }
            catch (Exception ex)
            { }
            return(role);
        }
        public static WFRole UpdateRole(string roleName, string description, int[] rights, bool enabled)
        {
            IWFAdminService svc         = Common.GetAdminAPI();
            WFRole          updatedRole = null;

            try
            {
                updatedRole = svc.UpdateRole(roleName, description, rights, true);
            }

            catch (Exception ex)
            {}
            return(updatedRole);
        }
Beispiel #3
0
        public static WFRole AddRole(String roleName, String description, int[] rights, bool enabled)
        {
            IWFAdminService svc  = Common.GetAdminAPI();
            WFRole          role = null;

            try
            {
                role = svc.AddRole(roleName, description, rights, true);
            }

            catch (Exception ex)
            {
            }
            return(role);
        }
Beispiel #4
0
        public List<WFRole> GetRoleList(int userAdminId, int WF)
        {
            List<WFRole> list = new List<WFRole>();
            var entities = from e in dbContext.UserAdmin_WFRoles
                           join f in dbContext.WFRoles on e.WFRoleID equals f.ID
                           where e.UserAdminId == userAdminId && e.IsActive == true && f.WFID == WF
                           orderby f.ID ascending

                           select new
                           {
                               ID = e.WFRoleID,
                               Name = f.Name
                           };

            foreach (var e in entities)
            {
                WFRole role = new WFRole();
                role.ID = e.ID;
                role.Name = e.Name;
                list.Add(role);
            }

            return list;
        }
Beispiel #5
0
        public List<WFRole> GetRoleListForApprovalUS(int WF)
        {
            List<WFRole> list = new List<WFRole>();
            var entities = from f in dbContext.WFRoles
                           where f.WFID == WF && f.ID != Constants.PR_PURCHASING_ID_US && f.ID != Constants.PR_REQUESTOR_ID_US && f.ID != Constants.PR_DEPARTMENT_HEAD
                           orderby f.ID ascending

                           select new
                           {
                               ID = f.ID,
                               Name = f.Name
                           };

            foreach (var e in entities)
            {
                WFRole role = new WFRole();
                role.ID = e.ID;
                role.Name = e.Name;
                list.Add(role);
            }

            return list;
        }