Esempio n. 1
0
        public TransactionDetailViewModel GetCompensationRegionModel()
        {
            var regions = new List <SelectListItem>();
            var codes   = new List <SelectListItem>();

            var compensationRegions = CompensationRegionService.GetAllCompensationRegions();

            regions.Add(new SelectListItem {
                Value = "0", Text = "--Seleccione--"
            });
            codes.Add(new SelectListItem {
                Value = "0", Text = "--Seleccione--"
            });

            foreach (var compensationRegion in compensationRegions)
            {
                regions.Add(new SelectListItem
                {
                    Value = compensationRegion.CompensationRegionId.ToString(),
                    Text  = compensationRegion.Region.ToString()
                });
                codes.Add(new SelectListItem
                {
                    Value = compensationRegion.CompensationRegionId.ToString(),
                    Text  = compensationRegion.Code.ToString()
                });
            }

            var model = new TransactionDetailViewModel();

            model.CompensationCodeList   = codes;
            model.CompensationRegionList = regions;

            return(model);
        }
        public ActionResult Index()
        {
            var model = new IndexViewModel();

            var allCompensationRegions     = CompensationRegionService.GetAllCompensationRegions();
            var groupedCompensationRegions = CompensationRegionService.GetCompensationRegionsGroupedByRegion();

            model.CompensationRegions        = allCompensationRegions.ToSelectList(c => c.Code, c => string.Format("{0}|{1}|{2}|{3}|{4}", c.Code, c.Region, c.SubRegion, c.Weeks, c.CompensationRegionId), null, "Seleccionar");
            model.GroupedCompensationRegions = groupedCompensationRegions.ToSelectList(c => c.Region, c => c.Region, null, "Seleccionar");

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult Index()
        {
            var model = new PreExistingViewModel();

            model.SearchModel = new Models.Case.SearchViewModel();

            var searchController = new SearchController();

            model.SearchModel.Regions = searchController.GetAllRegions().ToList();


            var allCompensationRegions     = CompensationRegionService.GetAllCompensationRegions();
            var groupedCompensationRegions = CompensationRegionService.GetCompensationRegionsGroupedByRegion();

            //model.transactionDetailModel = transactionDetailController.GetCompensationRegionModel();

            return(View(model));
        }