public CiaSegModel(CiaSeg ciaSeg) { if (ciaSeg != null) { Id = ciaSeg.Id; Nombre = ciaSeg.Nombre; UrlLogo = ciaSeg.UrlLogo.Replace("~/Content/images/logos/", ""); Estado = ciaSeg.Estado; } }
public ActionResult Registrar(CiaSegModel ciaSegModel) { if (ModelState.IsValid) { try { HttpPostedFileBase Logo = Request.Files["UrlLogo"]; if (Logo != null) { Logo.SaveAs(System.AppDomain.CurrentDomain.BaseDirectory + RutaImagen + Logo.FileName); } CiaSeg CiaSeg = new CiaSeg() { Nombre = ciaSegModel.Nombre, Estado = ciaSegModel.Estado, UrlLogo = RutaImagen + Logo.FileName, UsuarioRegistro = new Usuario() { Id = Convert.ToInt32(User.Identity.Name) }, FechaRegistro = DateTime.Now }; ViewBag.CiaSeg = CiaSegNegocio.Insertar(CiaSeg); } catch (Exception ex) { ViewBag.Exception = ex.Message; } } return View(ciaSegModel); }
public CiaSeg Insertar(CiaSeg ciaSeg) { return CiaSegRepo.Insertar(ciaSeg); }
public bool Eliminar(CiaSeg ciaSeg) { return CiaSegRepo.Eliminar(ciaSeg); }
public CiaSeg Actualizar(CiaSeg ciaSeg) { return CiaSegRepo.Actualizar(ciaSeg); }
public CiaSegModel(CiaSeg CiaSeg) { Id = CiaSeg.Id; Nombre = CiaSeg.Nombre; Estado = CiaSeg.Estado; }
public IEnumerable<Cobertura> BuscarPorCiaSeg(CiaSeg ciaSeg) { return CoberturaRepo.BuscarTodos().Where(item => item.CiaSeg.Id == ciaSeg.Id).OrderBy(item => item.Nombre); ; }