Esempio n. 1
0
 public ActionResult editUser(string personid, FormCollection collection)
 {
     try
     {
         Library_BL.User user = Library_BL.User.getByPersonId(personid);
         user.PersonId  = collection["PersonId"];
         user.FirstName = collection["FirstName"];
         user.LastName  = collection["LastName"];
         user.UserName  = collection["username"];
         user.Password  = collection["password"];
         user.save();
         return(RedirectToAction("ListUsers"));
     }
     catch (Exception er)
     {
         throw er;
     }
 }
Esempio n. 2
0
 public ActionResult CreateUser(FormCollection collection)
 {
     try
     {
         Library_BL.User user = new Library_BL.User();
         user.FirstName = collection["FirstName"];
         user.LastName  = collection["LastName"];
         user.PersonId  = collection["PersonId"];
         user.UserName  = collection["UserName"];
         user.Password  = collection["Password"];
         user.save();
         return(RedirectToAction("ListUsers"));
     }
     catch
     {
         return(View());
     }
 }