//se trae la vista con el modelo public ActionResult Index3(string NroTarjeta) { var model = new Index2ViewModel(); model.NroTarjeta = NroTarjeta; return(View(model)); }
public virtual IActionResult Index2(Index2ViewModel model) { model = new Index2ViewModel { Id = "hello", Value = 10 }; return(View(model)); }
public async Task <IActionResult> Index2() { ViewData["Title"] = $"{_appSettings.Value.AppTitle}-{Subtitle.TenderDashBoard}"; //if (!_session.IsAvailable || _session.GetString("UserId") == null) //{ // return RedirectToAction("Login", "UserInfo"); //} //else //{ var tenders = await _tenderService.GetTenderData("0"); var filteredData = tenders; //filteredData = filteredData.Where(x => x.BidSubmissionEnDate >= DateTime.Now).ToList(); //if (filteredData.Count == 0) //{ // filteredData = tenders; //} var nits = filteredData.Select(x => x.NIT) .Distinct() .Select(x => new SelectListItem() { Text = x, Value = x }); var orgs = filteredData.Select(x => x.Organisation) .Distinct() .Select(x => new SelectListItem() { Text = x, Value = x }); var depts = filteredData.Select(x => x.Department) .Distinct() .Select(x => new SelectListItem() { Text = x, Value = x }); List <string> divs = new List <string>(); foreach (var div in filteredData.Select(x => x.Division) .ToList()) { if (!string.IsNullOrEmpty(div)) { divs.AddRange(div.Split(",")); } } var noOfRowlst = _appSettings.Value.NoOfRowsOptions.Split(',').ToList(); var rowOption = _appSettings.Value.DefaultOptionRowSel; List <SelectListItem> NoOfRowsSelItemLst = new List <SelectListItem>(); foreach (var x in noOfRowlst) { NoOfRowsSelItemLst.Add(new SelectListItem() { Value = x, Text = x, Selected = (x == rowOption) }); } var i2viewmodel = new Index2ViewModel() { Nits = nits.ToList(), Departments = depts.ToList(), Oganisations = orgs.ToList(), Divisions = divs.Distinct().Select(x => new SelectListItem() { Text = x, Value = x }).ToList(), NoOfRows = NoOfRowsSelItemLst }; return(View(i2viewmodel)); //} }
public IActionResult Index2() { Index2ViewModel index2ViewModel = new Index2ViewModel(); return(View(index2ViewModel)); }