Ejemplo n.º 1
0
        public normal_user GetNormalUserEntity()
        {
            var normalUser = new normal_user();

            normalUser.user_id         = (int)UserID;
            normalUser.logon_id        = LogonID;
            normalUser.family_name     = FamilyName;
            normalUser.given_name      = GivenName;
            normalUser.generation      = (int)Generation;
            normalUser.age             = Age;
            normalUser.occupation_code = OccupationCode;
            return(normalUser);
        }
Ejemplo n.º 2
0
        public NormalUserViewModel(normal_user normalUser, email_address email)
        {
            UserID         = normalUser.user_id;
            LogonID        = normalUser.logon_id;
            FamilyName     = normalUser.family_name;
            GivenName      = normalUser.given_name;
            Generation     = normalUser.generation;
            Age            = normalUser.age;
            OccupationCode = normalUser.occupation_code;

            if (email != null)
            {
                EmailAddress = email.address;
            }
        }
Ejemplo n.º 3
0
        // GET: /NormalUsers/Edit/5
        public ActionResult Edit(int?id, int?generation)
        {
            if (id == null || generation == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var normalUserRepository   = R.NormalUserRepository;
            var emailAddressRepository = R.EmailAddressRepository;

            normal_user user = normalUserRepository.Find((int)id, (int)generation);

            if (user == null)
            {
                return(HttpNotFound());
            }

            var email = emailAddressRepository.Find(user.logon_id, user.generation);

            return(View(new NormalUserViewModel(user, email)));
        }