Example #1
0
            public Select2Response <object> GetByName(string q, int page)
            {
                var query = GetQuery();

                if (!string.IsNullOrEmpty(q))
                {
                    query = query.Where(s => s.Name.Contains(q));
                }
                var total = query.Count();

                var data = query.OrderBy(f => f.Name).Skip(page * 10).Take(10).Select(m => m.Name);

                return(Select2Response <object> .Create(data, total));
            }
Example #2
0
            public Select2Response <object> GetUserRoles(string q, int page, string id)
            {
                var userRoles = GetUserRoles(id);

                if (userRoles.Contains(RoleName.Admin))
                {
                    throw new ExceptionResult(Message.CantChangeAccess);
                }


                var data = new List <UserRoleVM>()
                {
                    //GetUserRole(RoleName.Admin,userRoles),
                    //GetUserRole(RoleName.Patient,userRoles),
                    //GetUserRole(RoleName.Doctor,userRoles),
                    //GetUserRole(RoleName.Provider,userRoles),
                };

                return(Select2Response <object> .Create(data, data.Count));
            }