Example #1
0
 public CiaSegModel(CiaSeg ciaSeg)
 {
     if (ciaSeg != null)
     {
         Id = ciaSeg.Id;
         Nombre = ciaSeg.Nombre;
         UrlLogo = ciaSeg.UrlLogo.Replace("~/Content/images/logos/", "");
         Estado = ciaSeg.Estado;
     }
 }
Example #2
0
        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);
        }
Example #3
0
 public CiaSeg Insertar(CiaSeg ciaSeg)
 {
     return CiaSegRepo.Insertar(ciaSeg);
 }
Example #4
0
 public bool Eliminar(CiaSeg ciaSeg)
 {
     return CiaSegRepo.Eliminar(ciaSeg);
 }
Example #5
0
 public CiaSeg Actualizar(CiaSeg ciaSeg)
 {
     return CiaSegRepo.Actualizar(ciaSeg);
 }
 public CiaSegModel(CiaSeg CiaSeg) 
 {
     Id = CiaSeg.Id;
     Nombre = CiaSeg.Nombre;
     Estado = CiaSeg.Estado;
 }
Example #7
0
 public IEnumerable<Cobertura> BuscarPorCiaSeg(CiaSeg ciaSeg)
 {
     return CoberturaRepo.BuscarTodos().Where(item => item.CiaSeg.Id == ciaSeg.Id).OrderBy(item => item.Nombre); ;
 }