Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. //Ingresando los Datos Get para mi vista Parcial
  2. public ActionResult _Empresas()
  3. {
  4. try
  5. {
  6. return PartialView();
  7. }
  8. catch (Exception e)
  9. {
  10. throw;
  11. }
  12. }
  13.  
  14. [HttpPost]
  15. [ValidateAntiForgeryToken]
  16. [ChildActionOnly]
  17. public ActionResult _Empresas([Bind(Include = "empresa_id,nombre_empresa,nombre_responsable,activa,telefono,email,fecha_registro")] cat_empresas cat_empresas)
  18. {
  19. try
  20. {
  21. if (ModelState.IsValid)
  22. {
  23. db.cat_empresas.Add(cat_empresas);
  24.  
  25. db.SaveChanges();
  26.  
  27. }
  28.  
  29. return PartialView();
  30. }
  31. catch (Exception ex)
  32. {
  33. throw;
  34. }
  35. }
Add Comment
Please, Sign In to add comment