Exemple #1
0
        // GET: CargFam

        #region Carg_CargFam
        public ActionResult Index()
        {
            try
            {
                using (CargFam = new EmpleadosEntities())
                {
                    var ListCargFam = CargFam.Sp_Mues_CargFam().ToList();

                    var ListCom = Comun.Sp_Mues_Comunas().ToList();
                    ViewBag.ListComu = new SelectList(ListCom, "Comuna_Id", "Comuna");

                    var LisSex = Sexo.Sexo.ToList();
                    ViewBag.ListSexos = new SelectList(LisSex, "Id_Sexo", "Descripcion");

                    var LisNac = Nacion.Nacionalidad.ToList();
                    ViewBag.ListNacion = new SelectList(LisNac, "Id_Nac", "Descripcion");

                    return(View(ListCargFam));
                }
            }catch (Exception ex)
            {
                Logger.Error("Error On:", ex);
                Response.StatusCode        = 500;
                Response.StatusDescription = ex.Message;
                return(Json(Response));
            }
        }
Exemple #2
0
 public ActionResult Index()
 {
     using (ManEmp = new EmpleadosEntities())
     {
         try
         {
             var ListEmp = ManEmp.Sp_Mues_Empresas().ToList();
             var ListCom = Comun.Sp_Mues_Comunas().ToList();
             ViewBag.ListComu = new SelectList(ListCom, "Comuna_Id", "Comuna");
             return(View(ListEmp));
         }catch (Exception ex) {
             Logger.Error("Error On:", ex);
             Response.StatusCode        = 500;
             Response.StatusDescription = ex.Message;
             return(Json(Response));
         }
     }
 }