public ActionResult Register(CiaSegModel ciaSegModel) { if (ModelState.IsValid) { CiaSeg CiaSeg = ciaSegModel.ObtenerEntidad(); CiaSeg.UsuarioRegistra.Id = Convert.ToInt32(User.Identity.Name); CiaSegNegocio.Insertar(CiaSeg); return RedirectToRoute("Aseguradora", new { action = "Search" }); } return View(ciaSegModel); }
public ActionResult New(CiaSegModel ciaSegModel) { if (ModelState.IsValid) { CiaSeg CiaSeg = ciaSegModel.ObtenerEntidad(); CiaSeg.UsuarioRegistra = new Usuario() { Id = Convert.ToInt32(User.Identity.Name) }; CiaSeg.FechaRegistro = DateTime.Now; CiaSegNegocio.Insertar(CiaSeg); return RedirectToRoute("Aseguradora", new { action = "Index" }); } return View(ciaSegModel); }