Ejemplo n.º 1
0
        public ActionResult Crear()
        {
            SelectorBL oSelectorBL = new SelectorBL();

            List <SelectOptionItem> oEstatus = oSelectorBL.EstatusUserSelector();
            List <SelectOptionItem> oRoles   = oSelectorBL.RolesSelector();

            List <SelectOptionItem> oNationalities = oSelectorBL.NationalitiesSelector();
            List <SelectOptionItem> oDocumentTypes = oSelectorBL.DocumentTypesSelector();
            List <SelectOptionItem> oDepartments   = oSelectorBL.DepartmentsSelector();


            List <SelectListItem> estatus = Helper.ConstruirDropDownList <SelectOptionItem>(oEstatus, "Value", "Text", "", true, "", "");
            List <SelectListItem> roles   = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "", "");

            List <SelectListItem> nationalities = Helper.ConstruirDropDownList <SelectOptionItem>(oNationalities, "Value", "Text", "", true, "", "");
            List <SelectListItem> documentTypes = Helper.ConstruirDropDownList <SelectOptionItem>(oDocumentTypes, "Value", "Text", "", true, "", "");
            List <SelectListItem> departments   = Helper.ConstruirDropDownList <SelectOptionItem>(oDepartments, "Value", "Text", "", true, "", "");

            List <SelectListItem> oListaVacia = Helper.ConstruirDropDownList <SelectOptionItem>(new List <SelectOptionItem>(), "Value", "Text", "", true, "", "");

            ViewBag.estatus       = estatus;
            ViewBag.roles         = roles;
            ViewBag.nationalities = nationalities;
            ViewBag.documentTypes = documentTypes;

            ViewBag.departments    = departments;
            ViewBag.municipalities = oListaVacia;

            List <SelectListItem> institutions = new List <SelectListItem>();

            ViewBag.institutions = institutions;

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Usuarios()
        {
            SelectorBL oSelectorBL         = new SelectorBL();
            List <SelectOptionItem> oRoles = oSelectorBL.RolesSelector();
            List <SelectListItem>   roles  = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "0", "TODOS");

            ViewBag.roles = roles;

            UsersReportFilterViewModel oUsersReportFilterViewModel = new UsersReportFilterViewModel();

            return(View(oUsersReportFilterViewModel));
        }
Ejemplo n.º 3
0
        public ActionResult Editar(string id)
        {
            UserBL oBL    = new UserBL();
            int    pIntID = 0;

            int.TryParse(id, out pIntID);
            UserViewModel pUserViewModel = oBL.ObtenerUser(pIntID);
            SelectorBL    oSelectorBL    = new SelectorBL();

            List <SelectOptionItem> oEstatus = oSelectorBL.EstatusUserSelector();
            List <SelectOptionItem> oRoles   = oSelectorBL.RolesSelector();

            List <SelectOptionItem> oNationalities = oSelectorBL.NationalitiesSelector();
            List <SelectOptionItem> oDocumentTypes = oSelectorBL.DocumentTypesSelector();

            List <SelectOptionItem> oDepartments    = oSelectorBL.DepartmentsSelector();
            List <SelectOptionItem> oMunicipalities = oSelectorBL.MunicipalitiesSelector(pUserViewModel.department_id.HasValue ? pUserViewModel.department_id.Value : 0);



            List <SelectListItem> estatus = Helper.ConstruirDropDownList <SelectOptionItem>(oEstatus, "Value", "Text", "", true, "", "");
            List <SelectListItem> roles   = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "", "");

            List <SelectListItem> nationalities = Helper.ConstruirDropDownList <SelectOptionItem>(oNationalities, "Value", "Text", "", true, "", "");
            List <SelectListItem> documentTypes = Helper.ConstruirDropDownList <SelectOptionItem>(oDocumentTypes, "Value", "Text", "", true, "", "");

            List <SelectListItem> departments    = Helper.ConstruirDropDownList <SelectOptionItem>(oDepartments, "Value", "Text", "", true, "", "");
            List <SelectListItem> municipalities = Helper.ConstruirDropDownList <SelectOptionItem>(oMunicipalities, "Value", "Text", "", true, "", "");

            ViewBag.estatus        = estatus;
            ViewBag.roles          = roles;
            ViewBag.nationalities  = nationalities;
            ViewBag.documentTypes  = documentTypes;
            ViewBag.departments    = departments;
            ViewBag.municipalities = municipalities;

            pUserViewModel.institutionsMultiSelectList = new MultiSelectList(oSelectorBL.InstitutionsSelector(pUserViewModel.institution_ids), "Value", "Text");


            return(View(pUserViewModel));
        }
Ejemplo n.º 4
0
        public ActionResult MiCuenta()
        {
            UserBL        oBL            = new UserBL();
            var           user_id        = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            UserViewModel pUserViewModel = oBL.ObtenerUser(user_id);
            SelectorBL    oSelectorBL    = new SelectorBL();

            List <SelectOptionItem> oEstatus = oSelectorBL.EstatusUserSelector();
            List <SelectOptionItem> oRoles   = oSelectorBL.RolesSelector();

            List <SelectOptionItem> oNationalities = oSelectorBL.NationalitiesSelector();
            List <SelectOptionItem> oDocumentTypes = oSelectorBL.DocumentTypesSelector();

            List <SelectOptionItem> oDepartments    = oSelectorBL.DepartmentsSelector();
            List <SelectOptionItem> oMunicipalities = oSelectorBL.MunicipalitiesSelector(pUserViewModel.department_id.HasValue ? pUserViewModel.department_id.Value : 0);



            List <SelectListItem> estatus = Helper.ConstruirDropDownList <SelectOptionItem>(oEstatus, "Value", "Text", "", true, "", "");
            List <SelectListItem> roles   = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "", "");

            List <SelectListItem> nationalities = Helper.ConstruirDropDownList <SelectOptionItem>(oNationalities, "Value", "Text", "", true, "", "");
            List <SelectListItem> documentTypes = Helper.ConstruirDropDownList <SelectOptionItem>(oDocumentTypes, "Value", "Text", "", true, "", "");

            List <SelectListItem> departments    = Helper.ConstruirDropDownList <SelectOptionItem>(oDepartments, "Value", "Text", "", true, "", "");
            List <SelectListItem> municipalities = Helper.ConstruirDropDownList <SelectOptionItem>(oMunicipalities, "Value", "Text", "", true, "", "");


            ViewBag.estatus        = estatus;
            ViewBag.roles          = roles;
            ViewBag.nationalities  = nationalities;
            ViewBag.documentTypes  = documentTypes;
            ViewBag.departments    = departments;
            ViewBag.municipalities = municipalities;

            return(View(pUserViewModel));
        }
Ejemplo n.º 5
0
        public ActionResult Editar(string id)
        {
            UserBL oBL    = new UserBL();
            int    pIntID = 0;

            int.TryParse(id, out pIntID);
            InvestigatorViewModel pViewModel = oBL.ObtenerInvestigator(pIntID);

            if (pViewModel == null)
            {
                pViewModel = new InvestigatorViewModel();
            }

            SelectorBL oSelectorBL = new SelectorBL();

            if (pViewModel != null)
            {
                pViewModel.birthdate_text = pViewModel.birthdate.HasValue ? pViewModel.birthdate.Value.ToString("dd/MM/yyyy") : String.Empty;
            }
            List <SelectOptionItem> oEstatus = oSelectorBL.EstatusUserSelector();
            List <SelectOptionItem> oRoles   = oSelectorBL.RolesSelector();

            List <SelectOptionItem> oNationalities = oSelectorBL.NationalitiesSelector();
            List <SelectOptionItem> oDocumentTypes = oSelectorBL.DocumentTypesSelector();

            List <SelectOptionItem> oGenders        = oSelectorBL.GendersSelector();
            List <SelectOptionItem> oPrograms       = oSelectorBL.ProgramsSelector((pViewModel.educational_institution_id != null ? pViewModel.educational_institution_id.Value : 0));
            List <SelectOptionItem> oInterestAreas  = oSelectorBL.InterestAreasSelector();
            List <SelectOptionItem> oDepartments    = oSelectorBL.DepartmentsSelector();
            List <SelectOptionItem> oMunicipalities = oSelectorBL.MunicipalitiesSelector(pViewModel != null && pViewModel.department_id.HasValue? pViewModel.department_id.Value:0);

            List <SelectOptionItem> oAcademicLevels          = oSelectorBL.AcademicLevelsSelector();
            List <SelectOptionItem> oCommissions             = oSelectorBL.CommissionsSelector();
            List <SelectOptionItem> oEducationalInstitutions = oSelectorBL.EducationalInstitutionsSelector();

            List <SelectOptionItem> oEducationLevels = oSelectorBL.EducationLevelsSelector((pViewModel.educational_institution_id != null ? pViewModel.educational_institution_id.Value : 0), (pViewModel.program_id != null ? pViewModel.program_id.Value : 0));

            List <SelectOptionItem> oInvestigationGroups = oSelectorBL.InvestigationGroupsSelector((pViewModel.institution_id != null ? pViewModel.institution_id.Value : 0));

            List <SelectListItem> estatus = Helper.ConstruirDropDownList <SelectOptionItem>(oEstatus, "Value", "Text", "", true, "", "");
            List <SelectListItem> roles   = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "", "");

            List <SelectListItem> nationalities = Helper.ConstruirDropDownList <SelectOptionItem>(oNationalities, "Value", "Text", "", true, "", "");
            List <SelectListItem> documentTypes = Helper.ConstruirDropDownList <SelectOptionItem>(oDocumentTypes, "Value", "Text", "", true, "", "");
            List <SelectListItem> genders       = Helper.ConstruirDropDownList <SelectOptionItem>(oGenders, "Value", "Text", "", true, "", "");

            List <SelectListItem> programs       = Helper.ConstruirDropDownList <SelectOptionItem>(oPrograms, "Value", "Text", "", true, "", "");
            List <SelectListItem> interest_areas = Helper.ConstruirDropDownList <SelectOptionItem>(oInterestAreas, "Value", "Text", "", false, "", "");
            List <SelectListItem> departments    = Helper.ConstruirDropDownList <SelectOptionItem>(oDepartments, "Value", "Text", "", true, "", "");
            List <SelectListItem> municipalities = Helper.ConstruirDropDownList <SelectOptionItem>(oMunicipalities, "Value", "Text", "", true, "", "");

            List <SelectListItem> academic_levels          = Helper.ConstruirDropDownList <SelectOptionItem>(oAcademicLevels, "Value", "Text", "", true, "", "");
            List <SelectListItem> commissions              = Helper.ConstruirDropDownList <SelectOptionItem>(oCommissions, "Value", "Text", "", true, "", "");
            List <SelectListItem> educational_institutions = Helper.ConstruirDropDownList <SelectOptionItem>(oEducationalInstitutions, "Value", "Text", "", true, "", "");


            List <SelectListItem> investigation_groups = Helper.ConstruirDropDownList <SelectOptionItem>(oInvestigationGroups, "Value", "Text", "", true, "", "");
            List <SelectListItem> education_levels     = Helper.ConstruirDropDownList <SelectOptionItem>(oEducationLevels, "Value", "Text", "", true, "", "");


            List <SelectListItem> oListaVacia = Helper.ConstruirDropDownList <SelectOptionItem>(new List <SelectOptionItem>(), "Value", "Text", "", true, "", "");


            interest_areas = interest_areas.Select(a => new SelectListItem
            {
                Text     = a.Text,
                Value    = a.Value,
                Selected = (pViewModel.interest_areas != null ?  pViewModel.interest_areas.Contains(int.Parse(a.Value)) : false)
            }).ToList();


            List <SelectListItem> institutions = new List <SelectListItem>();

            if (pViewModel.institution != null)
            {
                institutions.Add(new SelectListItem
                {
                    Text     = pViewModel.institution,
                    Value    = pViewModel.institution_id.ToString(),
                    Selected = true
                });
            }


            ViewBag.programs                 = programs;
            ViewBag.education_levels         = education_levels;
            ViewBag.educational_institutions = educational_institutions;


            ViewBag.institutions         = institutions;
            ViewBag.investigation_groups = investigation_groups;
            ViewBag.interest_areas       = interest_areas;
            //  ViewBag.programs = programs;
            ViewBag.departments    = departments;
            ViewBag.municipalities = municipalities;

            ViewBag.estatus         = estatus;
            ViewBag.roles           = roles;
            ViewBag.nationalities   = nationalities;
            ViewBag.documentTypes   = documentTypes;
            ViewBag.genders         = genders;
            ViewBag.academic_levels = academic_levels;

            pViewModel.commissionsMultiSelectList = new MultiSelectList(oSelectorBL.CommissionsSelector(), "Value", "Text");



            return(View(pViewModel));
        }
Ejemplo n.º 6
0
        public ActionResult Crear()
        {
            SelectorBL oSelectorBL = new SelectorBL();

            List <SelectOptionItem> oEstatus = oSelectorBL.EstatusUserSelector();
            List <SelectOptionItem> oRoles   = oSelectorBL.RolesSelector();

            List <SelectOptionItem> oNationalities = oSelectorBL.NationalitiesSelector();
            List <SelectOptionItem> oDocumentTypes = oSelectorBL.DocumentTypesSelector();

            List <SelectOptionItem> oGenders       = oSelectorBL.GendersSelector();
            List <SelectOptionItem> oPrograms      = oSelectorBL.ProgramsSelector();
            List <SelectOptionItem> oInterestAreas = oSelectorBL.InterestAreasSelector();
            List <SelectOptionItem> oDepartments   = oSelectorBL.DepartmentsSelector();

            List <SelectOptionItem> oAcademicLevels          = oSelectorBL.AcademicLevelsSelector();
            List <SelectOptionItem> oCommissions             = oSelectorBL.CommissionsSelector();
            List <SelectOptionItem> oEducationalInstitutions = oSelectorBL.EducationalInstitutionsSelector();

            List <SelectListItem> estatus = Helper.ConstruirDropDownList <SelectOptionItem>(oEstatus, "Value", "Text", "", true, "", "");
            List <SelectListItem> roles   = Helper.ConstruirDropDownList <SelectOptionItem>(oRoles, "Value", "Text", "", true, "", "");

            List <SelectListItem> nationalities = Helper.ConstruirDropDownList <SelectOptionItem>(oNationalities, "Value", "Text", "", true, "", "");
            List <SelectListItem> documentTypes = Helper.ConstruirDropDownList <SelectOptionItem>(oDocumentTypes, "Value", "Text", "", true, "", "");
            List <SelectListItem> genders       = Helper.ConstruirDropDownList <SelectOptionItem>(oGenders, "Value", "Text", "", true, "", "");

            List <SelectListItem> programs                 = Helper.ConstruirDropDownList <SelectOptionItem>(oPrograms, "Value", "Text", "", true, "", "");
            List <SelectListItem> interest_areas           = Helper.ConstruirDropDownList <SelectOptionItem>(oInterestAreas, "Value", "Text", "", false, "", "");
            List <SelectListItem> departments              = Helper.ConstruirDropDownList <SelectOptionItem>(oDepartments, "Value", "Text", "", true, "", "");
            List <SelectListItem> academic_levels          = Helper.ConstruirDropDownList <SelectOptionItem>(oAcademicLevels, "Value", "Text", "", true, "", "");
            List <SelectListItem> commissions              = Helper.ConstruirDropDownList <SelectOptionItem>(oCommissions, "Value", "Text", "", true, "", "");
            List <SelectListItem> educational_institutions = Helper.ConstruirDropDownList <SelectOptionItem>(oEducationalInstitutions, "Value", "Text", "", true, "", "");

            List <SelectListItem> oListaVacia = Helper.ConstruirDropDownList <SelectOptionItem>(new List <SelectOptionItem>(), "Value", "Text", "", true, "", "");



            ViewBag.programs                 = oListaVacia;
            ViewBag.education_levels         = oListaVacia;
            ViewBag.educational_institutions = educational_institutions;


            ViewBag.institutions         = oListaVacia;
            ViewBag.investigation_groups = oListaVacia;
            ViewBag.interest_areas       = interest_areas;
            //  ViewBag.programs = programs;
            ViewBag.departments    = departments;
            ViewBag.municipalities = oListaVacia;

            ViewBag.estatus         = estatus;
            ViewBag.roles           = roles;
            ViewBag.nationalities   = nationalities;
            ViewBag.documentTypes   = documentTypes;
            ViewBag.genders         = genders;
            ViewBag.academic_levels = academic_levels;
            ViewBag.commissions     = commissions;



            InvestigatorViewModel pViewModel       = new InvestigatorViewModel();
            ConfigurationBL       oConfigurationBL = new ConfigurationBL();

            pViewModel.terms_conditions = oConfigurationBL.Obtener().terms_conditions;

            pViewModel.commissionsMultiSelectList = new MultiSelectList(oSelectorBL.CommissionsSelector(), "Value", "Text");

            return(View(pViewModel));
        }