Exemple #1
0
        public UserEditViewModel Registration()
        {
            var divRepo = new DivisionRepository();
            var disRepo = new DistrictRepository();

            var user = new UserEditViewModel();

            user.Divisions = divRepo.GetDivisions();
            user.Districts = disRepo.GetDistricts();

            return(user);
        }
Exemple #2
0
        public UserEditViewModel GetUser(int id)
        {
            UserEditViewModel user = new UserEditViewModel();
            string            sql  = "Select * from users where userid = " + id;
            var users = SqlDataAccess.LoadData <UserEditViewModel>(sql);

            if (users.Count > 0)
            {
                user = users[0];
            }

            var divRepo = new DivisionRepository();
            var disRepo = new DistrictRepository();

            user.Divisions = divRepo.GetDivisions();
            user.Districts = disRepo.GetDistricts(user.DivisionId);

            return(user);
        }