Ejemplo n.º 1
0
        public ActionResult GetRoleDescriptionByRoleID(int RoleID)
        {
            try
            {
                var _description = db.ups_Roles_GetRoles().Where(x => x.RoleID == RoleID).Select(x => x.RoleDescription).FirstOrDefault();

                return(Json(new { Result = _description }, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json(new { Result = string.Empty }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 2
0
        public IList <Roles> GetRoles(int id = 0)
        {
            IList <Roles> _roles = new List <Roles>();

            try
            {
                _roles = _context.ups_Roles_GetRoles()
                         .Select(x => new Roles
                {
                    RoleID          = x.RoleID,
                    RoleName        = x.RoleName,
                    RoleDescription = x.RoleDescription
                }).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_roles);
        }