public ActionResult RegisterUser(UserAccount user)
 {
     try
     {
         _context.Add(user);
         _context.SaveChanges();
         ViewBag.message = user.Name + "has got successfull";
         return(View("Login"));
     }
     catch (Exception e)
     {
         ViewBag.message = user.Name + "failed";
     }
     return(View());
 }
示例#2
0
 public ActionResult RegisterUser(UserAccount ua)
 {
     try
     {
         _context.Add(ua);
         _context.SaveChanges();
         ViewBag.message = ua.UserName + " has got successfully Registered";
         return(RedirectToAction("Login"));
     }
     catch (Exception e)
     {
         ViewBag.message = ua.UserName + " Registration Failed!!!";
         return(View());
     }
 }