Example #1
0
        public PartialViewResult _OfertaSectorEmpresarialCrear(OfertaSectorEmpresarial ofertaSector)
        {
            if (ModelState.IsValid)
            {
                TicketEmpresa ticket = (TicketEmpresa)Session["TicketEmpresa"];

                //ofertaSector.IdOferta = 13;
                //ofertaSector.SectorEmpresarial.IdListaValor = "ABE";
                //ofertaSector.ExperienciaExcluyente = false;
                //ofertaSector.AniosTrabajados = 3;
                ofertaSector.EstadoOfertaSectorEmpresarial.IdListaValor = "OFSEAC"; //Oferrta sector empresarial activa.
                ofertaSector.CreadoPor = ticket.Usuario;

                LNOfertaSectorEmpresarial lnOfertaSector = new LNOfertaSectorEmpresarial();
                lnOfertaSector.Insertar(ofertaSector);

                List <OfertaSectorEmpresarial> lista = lnSector.ObtenerSectoresEmpresariales(ofertaSector.IdOferta, 0);

                ViewBag.IdOferta = ofertaSector.IdOferta;
                return(PartialView("_OfertaSectorEmpresarial", lista));
            }
            else
            {
                //Código para ubicar los errores en el ModelState.
                var errors = ModelState.Select(x => x.Value.Errors)
                             .Where(y => y.Count > 0)
                             .ToList();

                int a = 0;
            }
            return(PartialView("_OfertaSectorEmpresarialCrear", ofertaSector));
        }
Example #2
0
 public void Insertar(OfertaSectorEmpresarial ofertaSectorEmpresarial)
 {
     lnSector.Insertar(ofertaSectorEmpresarial);
 }