Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public async Task<ActionResult> Create(Employee e)
  2. {
  3.  
  4. if (ModelState.IsValid)
  5. {
  6. try
  7. {
  8. service.Save(e);
  9. RedirectToAction("Index");
  10. }
  11. catch (CorreoExisteException ex)
  12. {
  13. ModelState.AddModelError("email", ex.Message);
  14. }
  15. catch (CodigoExisteException ex)
  16. {
  17. ModelState.AddModelError("code", ex.Message);
  18. }
  19.  
  20.  
  21. }
  22.  
  23. return View(e);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement