コード例 #1
0
ファイル: DraftLawController.cs プロジェクト: alonsodev/SSR
        public ActionResult Editar(string id)
        {
            DraftLawBL oBL    = new DraftLawBL();
            int        pIntID = 0;

            int.TryParse(id, out pIntID);
            DraftLawViewModel       pDraftLawViewModel = oBL.Obtener(pIntID);
            SelectorBL              oSelectorBL        = new SelectorBL();
            List <SelectOptionItem> oCommissions       = oSelectorBL.CommissionsSelector();
            List <SelectListItem>   commissions        = Helper.ConstruirDropDownList <SelectOptionItem>(oCommissions, "Value", "Text", "", true, "", "");

            ViewBag.commissions = commissions;
            List <SelectOptionItem> oInterestAreas = oSelectorBL.InterestAreasSelector();
            List <SelectListItem>   interest_areas = Helper.ConstruirDropDownList <SelectOptionItem>(oInterestAreas, "Value", "Text", "", true, "", "");

            ViewBag.interest_areas = interest_areas;
            if (pDraftLawViewModel.date_presentation.HasValue)
            {
                pDraftLawViewModel.date_presentation_text = pDraftLawViewModel.date_presentation.Value.ToString("dd/MM/yyyy");
            }

            pDraftLawViewModel.period_closed = 1;
            if (pDraftLawViewModel.start_date <= DateTime.Today && pDraftLawViewModel.end_date >= DateTime.Today)
            {
                pDraftLawViewModel.period_closed = 0;
            }

            return(View(pDraftLawViewModel));
        }
コード例 #2
0
ファイル: DraftLawController.cs プロジェクト: alonsodev/SSR
        public ActionResult Crear()
        {
            SelectorBL oSelectorBL = new SelectorBL();
            List <SelectOptionItem> oCommissions = oSelectorBL.CommissionsSelector();
            List <SelectListItem>   commissions  = Helper.ConstruirDropDownList <SelectOptionItem>(oCommissions, "Value", "Text", "", true, "", "");

            ViewBag.commissions = commissions;
            List <SelectOptionItem> oInterestAreas = oSelectorBL.InterestAreasSelector();
            List <SelectListItem>   interest_areas = Helper.ConstruirDropDownList <SelectOptionItem>(oInterestAreas, "Value", "Text", "", true, "", "");

            ViewBag.interest_areas = interest_areas;
            return(View());
        }
コード例 #3
0
        // GET: User
        public ActionResult Index()
        {
            SelectorBL oSelectorBL = new SelectorBL();
            List <SelectOptionItem> oCommissions = oSelectorBL.CommissionsSelector();
            List <SelectListItem>   commissions  = Helper.ConstruirDropDownList <SelectOptionItem>(oCommissions, "Value", "Text", "", true, "0", "TODOS");

            ViewBag.commissions = commissions;

            List <SelectOptionItem> oInterestAreas = oSelectorBL.InterestAreasSelector();
            List <SelectListItem>   interest_areas = Helper.ConstruirDropDownList <SelectOptionItem>(oInterestAreas, "Value", "Text", "", true, "0", "TODOS");

            ViewBag.commissions    = commissions;
            ViewBag.interest_areas = interest_areas;

            List <SelectOptionItem> oEstados = oSelectorBL.StatusSelector();
            List <SelectListItem>   estados  = Helper.ConstruirDropDownList <SelectOptionItem>(oEstados, "Value", "Text", "", true, "0", "TODOS");

            ViewBag.commissions = commissions;
            ViewBag.estados     = estados;


            List <SelectOptionItem> oOrigins = oSelectorBL.OriginSelector();
            List <SelectListItem>   origins  = Helper.ConstruirDropDownList <SelectOptionItem>(oOrigins, "Value", "Text", "", true, "0", "TODOS");

            ViewBag.commissions = commissions;
            ViewBag.origins     = origins;


            List <SelectOptionItem> oPeriods = oSelectorBL.PeriodsSelector();
            List <SelectListItem>   periods  = Helper.ConstruirDropDownList <SelectOptionItem>(oPeriods, "Value", "Text", "", false, "", "");

            ViewBag.commissions = commissions;
            ViewBag.periods     = periods;
            PeriodBL        oPeriodBL = new PeriodBL();
            PeriodViewModel oPeriod   = oPeriodBL.ObtenerVigente();



            ReportFilterViewModel oReportFilterViewModel = new ReportFilterViewModel();

            oReportFilterViewModel.period_id = oPeriod.period_id;
            return(View(oReportFilterViewModel));
        }
コード例 #4
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));
        }
コード例 #5
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));
        }