Пример #1
0
        public IList <CreateUserViewModel> GetAllUsers(bool IsActive = true)
        {
            IList <CreateUserViewModel> viewUsers = new List <CreateUserViewModel>();

            try
            {
                viewUsers = _context.usp_Users_GetAllUsers(IsActive)
                            .Select(x => new CreateUserViewModel
                {
                    UserID            = x.UserID,
                    DisplayID         = x.DisplayID,
                    DisplayName       = x.DisplayName,
                    DOB               = x.DOB,
                    DOJ               = x.DOJ,
                    email             = x.Email,
                    firstName         = x.FirstName,
                    lastName          = x.LastName,
                    middleName        = x.MiddleName,
                    Mobile            = x.Mobile,
                    OtherEmailAddress = x.OtherEmailAddress,
                    roleID            = x.RoleID,
                    RoleName          = x.RoleName,
                    WorkTitle         = x.WorkTitle,
                    workTitleID       = x.WorkTitleID,
                    IsLoginActive     = x.IsLoginActive,
                    Status            = x.IsLoginActive == true ? "Active" : "In Active",
                    IsUserActive      = x.IsUserActive
                }).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(viewUsers);
        }