示例#1
0
        public ActionResult NewUser()
        {
            TempData["AccType"]    = AccountTypeRepo.GetAll();
            TempData["UserType"]   = UserTypeRepo.GetAll();
            TempData["UserStatus"] = UserStatusRepo.GetAll();

            return(View());
        }
        public ActionResult Index()
        {
            List <UserType> usertypes = userTypeRepo.GetAll();

            ViewBag.userTypes = usertypes;

            return(View());
        }
示例#3
0
        public ActionResult Users()
        {
            List <User>     users     = userRepo.GetAll();
            List <UserType> userTypes = userTypeRepo.GetAll();

            ViewBag.allusers     = users;
            ViewBag.alluserTypes = userTypes;
            return(View());
        }
示例#4
0
        public async Task <IActionResult> Login(Guid shelterId)
        {
            ViewBag.UserAccounts = await _accountUserRepo.GetAll();

            ViewBag.userTypes = await _userTypeRepo.GetAll();

            if (shelterId.Equals(Guid.Empty))
            {
                return(View(new AccountUser()));
            }
            else
            {
                return(View(await _accountUserRepo.GetById(shelterId)));
            }
        }
示例#5
0
        private void LoadUserTypeData()
        {
            TracktorDb            context      = new TracktorDb();
            UserTypeRepository    UserTypeRepo = new UserTypeRepository(context);
            List <UserTypeEntity> UserTypes    = UserTypeRepo.GetAll().ToList();

            AllUserTypes = new BindingList <UserTypeEntity>(UserTypes);
        }
示例#6
0
        public async Task <IActionResult> Index()
        {
            AccountUser use = new AccountUser();

            ViewBag.userTypes = await _userTypeRepo.GetAll();

            return(View(new AccountUser()));
        }
示例#7
0
        public List <SelectListItem> GetAllUserTypes()
        {
            IUserTypeRepository   userTypeRepo = new UserTypeRepository();
            List <SelectListItem> userTypeList = new List <SelectListItem>();

            userTypeList = userTypeRepo.GetAll().Select(x => new SelectListItem()
            {
                Text = x.UserType, Value = x.ID.ToString()
            }
                                                        ).ToList();
            return(userTypeList);
        }
示例#8
0
        public static List <UserTypeData> GetUserTypes()
        {
            UserTypeRepository  userTypeRep = new UserTypeRepository();
            List <UserTypeData> userTypes   = new List <UserTypeData>();

            userTypeRep.GetAll().ToList().ForEach(x => userTypes.Add(new UserTypeData
            {
                Id   = x.Id,
                Name = x.Name
            }));
            return(userTypes);
        }
示例#9
0
        public void GetAll_AllUserTypesReturned_CountEqualActual()
        {
            const int expectedCount = 2;
            int       actualCount;

            using (var userTypeRepo = new UserTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                actualCount = userTypeRepo.GetAll().Count();
            }

            Assert.AreEqual(expectedCount, actualCount);
        }
示例#10
0
        public async Task <IActionResult> Index()
        {
            if (PasswordHash.userauth == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            IEnumerable <Shelter> shelters = await _shelterRepo.GetAll();

            IEnumerable <Dog> dogs = await _dogRepo.GetAll();

            ViewBag.userTypes = await _userTypeRepo.GetAll();

            DisplayData displayData = new DisplayData
            {
                Shelters  = shelters,
                Dogs      = dogs,
                City      = "Salt Lake City",
                StateCode = "UT"
            };

            return(View(displayData));
        }
示例#11
0
 public IHttpActionResult Get()
 {
     return(Ok(userTypeRepo.GetAll()));
 }
示例#12
0
 public IActionResult Get()
 {
     return(Ok(_userTypeRepository.GetAll()));
 }
示例#13
0
        /// <summary>
        /// The actual Work to be done.
        /// </summary>
        protected override void Execute()
        {
            MainFormModel mainFormModel = null;

            List <RepositoryModel> repositoryList   = new List <RepositoryModel>();
            List <CollectionModel> newlist          = new List <CollectionModel>();
            List <SubseryModel>    newSubseriesList = new List <SubseryModel>();
            List <SubjectModel>    subjectList      = new List <SubjectModel>();
            List <KeywordModel>    keywordList      = new List <KeywordModel>();
            List <UserTypeModel>   userTypes        = new List <UserTypeModel>();

            //if (Request.IsStartup)
            //{
            mainFormModel = new MainFormModel()
            {
                BrowseRecordCount            = TranscriptionRepository.GetAll().Count(),
                TranscrptionQueueRecordCount = TranscriptionRepository.FindBy(t => t.TranscriptStatus == false).Count(),
            };

            // collect repository details.
            List <repository> repositories = RepositoryRepository.GetRepositoriess();

            foreach (repository item in repositories)
            {
                repositoryList.Add(Util.ConvertToRepositoryModel(item));
            }

            // collect collection details.
            List <collection> collections = CollectionRepository.GetCollections().OrderBy(c => c.CollectionName).ToList();

            foreach (collection item in collections)
            {
                newlist.Add(Util.ConvertToCollectionModel(item, repositories.First(c => c.Id == item.RepositoryId).RepositoryName));
            }

            // collect subseries details.
            foreach (subsery item in SubseryRepository.GetSubseries().OrderBy(s => s.SubseriesName))
            {
                newSubseriesList.Add(Util.ConvertToSubseryModel(item, collections.FirstOrDefault(s => s.Id == item.CollectionId).CollectionName));
            }

            // collect subject details.
            foreach (subject item in SubjectRepository.GetSubjects())
            {
                subjectList.Add(Util.ConvertToSubjectModel(item));
            }

            // collect keywords details.
            foreach (keyword item in KeywordRepository.GetKeywords())
            {
                keywordList.Add(Util.ConvertToKeywordModel(item));
            }

            // collect user types details.
            foreach (usertype item in UserTypeRepository.GetAll())
            {
                userTypes.Add(Util.ConvertToUsertypeModel(item));
            }
            //}

            List <PredefinedUserModel> predefineUserList = Util.ConvertToPredefinedUserModel(PredefineUserRepository.GetPredefinedUsers());

            List <string> audioEquipmentsUsed = AudioEquipmentUsedRepository.List();

            List <string> videoEquipmentsUsed = VideoEquipmentUsedRepository.List();

            Response = new ResponseModel()
            {
                Repositories = repositoryList,
                Subseries    = newSubseriesList,
                Collections  = newlist,
                Subjects     = subjectList,
                Keywords     = keywordList,

                PredefinedUsers     = predefineUserList,
                AudioEquipmentsUsed = audioEquipmentsUsed,
                VideoEquipmentsUsed = videoEquipmentsUsed,
                UserTypes           = userTypes,

                MainFormModel      = mainFormModel,
                IsOperationSuccess = true
            };
        }
示例#14
0
 public ActionResult SignUp()
 {
     TempData["UserType"] = UserTypeRepo.GetAll();
     return(View());
 }