コード例 #1
0
 public ProfileViewModel()
 {
     Heights = new List<Height>();
     Occupations = new List<Occupation>();
     UserProfile = new UserProfileModel();
     Requests = new List<Request>();
 }
コード例 #2
0
 public ActionResult Register(UserProfileModel user)
 {
     user.IsVerified = "false";
     user.Age = DateTime.Now.Subtract(user.DateOfBirth).Days/365;
     ViewBag.UserExists = !_entityUser.AddNew(user.MapClientToServer());
     
     return View("Register");
 }
コード例 #3
0
 public ActionResult Login(UserProfileModel user)
 {
     
     var temp = _entityUser.GetUser(user.Email);
     if (_entityUser.IsUser(user.MapClientToServer()))
     {
         Session["user"] = temp.MapServerToClient();
         Session.Timeout = 30;
     }
         
     else
     {
         ViewBag.isUser = false;
         return View();
     }
     
     return RedirectToAction("Index", "Home");
 }