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); }
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; } }
// 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))); }