public void FilterLists() { var visaStatusFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" }, new SelectListItem { Value = "1", Text = "New Visas" }, new SelectListItem { Value = "2", Text = "Assigned Visas" }, }; var cats = new SelectList(visaStatusFilterList, "value", "text"); @ViewData["VisaStatus"] = cats; //Agency var agencies = HelperUtility.GetAgencies(); var agencyFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "Do Not Assign" } }; agencyFilterList.AddRange(agencies); @ViewData["AgencyFilter"] = new SelectList(agencyFilterList, "value", "text"); var agencyList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" } }; agencyList.AddRange(agencies); @ViewData["AgencyList"] = new SelectList(agencyList, "value", "text"); //Agents var agentFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "Do Not Assign" } }; var agents = HelperUtility.GetAgents(); agentFilterList.AddRange(agents.Select(agent => new SelectListItem { Value = agent.Value, Text = agent.Text })); //agentFilterList.AddRange(HelperUtility.GetAgents()); @ViewData["AgentFilter"] = new SelectList(agentFilterList, "value", "text"); agentFilterList[0].Text = "All"; // new SelectListItem { Value = "-1", Text = "All" }; @ViewData["AgentList"] = new SelectList(agentFilterList, "value", "text"); }
public void FilterLists() { var employeeStatusFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" }, new SelectListItem { Value = "0", Text = "Visa Waiting" }, new SelectListItem { Value = "11", Text = "Visa Assigned" }, new SelectListItem { Value = Convert.ToInt32(ProcessStatusTypes.OnProcess).ToString(), Text = "On Process" }, new SelectListItem { Value = "4", Text = "Stammped & Flight Processing" }, new SelectListItem { Value = "44", Text = "Booked or Departured" }, new SelectListItem { Value = Convert.ToInt32(ProcessStatusTypes.OnGoodCondition).ToString(), Text = "Arrived & On Good Condition" }, new SelectListItem { Value = Convert.ToInt32(ProcessStatusTypes.Returned).ToString(), Text = "Returned" }, new SelectListItem { Value = Convert.ToInt32(ProcessStatusTypes.Lost).ToString(), Text = "Lost" }, new SelectListItem { Value = Convert.ToInt32(ProcessStatusTypes.WithComplain).ToString(), Text = "With Complain" } }; var cats = new SelectList(employeeStatusFilterList, "value", "text"); @ViewData["EmployeeStatus"] = cats; //Experince var experienceFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" }, new SelectListItem { Value = "0", Text = "No Experience" }, new SelectListItem { Value = "1", Text = "With Experience" }, }; var exps = new SelectList(experienceFilterList, "value", "text"); @ViewData["ExperienceFilter"] = exps; //Age var ageFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" } }; ageFilterList.AddRange(HelperUtility.AgeCategoryEnums()); @ViewData["AgeFilter"] = new SelectList(ageFilterList, "value", "text"); //Religion var religionFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" } }; religionFilterList.AddRange(HelperUtility.ReligionEnums()); @ViewData["ReligionFilter2"] = new SelectList(religionFilterList, "value", "text"); //Language var languageFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" } }; languageFilterList.AddRange(HelperUtility.LanguageExperienceEnums()); @ViewData["LanguageFilter2"] = new SelectList(languageFilterList, "value", "text"); //Agency var agencies = HelperUtility.GetAgencies(); var agencyFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "Do Not Assign" } }; agencyFilterList.AddRange(agencies); @ViewData["AgencyFilter"] = new SelectList(agencyFilterList, "value", "text"); var agencyList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "All" } }; agencyList.AddRange(agencies); @ViewData["AgencyList"] = new SelectList(agencyList, "value", "text"); //Agents var agentFilterList = new List <SelectListItem> { new SelectListItem { Value = "-1", Text = "Do Not Assign" } }; var agents = HelperUtility.GetAgents(); agentFilterList.AddRange(agents.Select(agent => new SelectListItem { Value = agent.Value, Text = agent.Text })); //agentFilterList.AddRange(HelperUtility.GetAgents()); @ViewData["AgentFilter"] = new SelectList(agentFilterList, "value", "text"); agentFilterList[0].Text = "All"; // new SelectListItem { Value = "-1", Text = "All" }; @ViewData["AgentList"] = new SelectList(agentFilterList, "value", "text"); }