public ActionResult Index() { //string search = Session["Search"].ToString(); var categories = categoriesBLL.GetDAL().GetList(5, 1); var activities = activitiesBLL.GetDAL().GetList(5, 1); Models.SearchViewModel searchvm = new Models.SearchViewModel(); searchvm.Categories = categories; searchvm.Activities = activities; return(View(searchvm)); }
public ActionResult SearchResult(string Soegetxt) { Models.SearchViewModel Soegresultat = new Models.SearchViewModel(); if (Soegetxt != "") { Soegresultat.Events = db.EventsTbs.Where(j => j.EventTitle.Contains(Soegetxt) || j.Region.Contains(Soegetxt) || j.Rubrik.Contains(Soegetxt) || j.UnderBrik.Contains(Soegetxt)).ToList(); Soegresultat.Medlems = db.Bestyrelse_Tbs.Where(f => f.MedlemName.Contains(Soegetxt) || f.MedlemBeskrivelse.Contains(Soegetxt) || f.BestyrelseRole.MedlemRole.Contains(Soegetxt)).ToList(); } return(View(Soegresultat)); }
public ActionResult Search(long typeId, long?regionId, string monthRent, string orderByType) { SearchViewModel model = new Models.SearchViewModel(); HouseSearchResult result = new HouseSearchResult(); HouseSearchOptions options = new HouseSearchOptions(); options.CityId = 4; options.TypeId = typeId; options.RegionId = regionId; options.CurrentIndex = 1; options.PageSize = 10; int?startMonthRent; int?endMonthRent; GetMonthRent(monthRent, out startMonthRent, out endMonthRent); options.StartMonthRent = startMonthRent; options.EndMonthRent = endMonthRent; switch (orderByType) { case "AscMonthRent": options.OrderByType = OrderByType.MonRentAsc; break; case "DescMonthRent": options.OrderByType = OrderByType.MonthRentDesc; break; case "AscArea": options.OrderByType = OrderByType.AreaAsc; break; case "DescArea": options.OrderByType = OrderByType.AreaDesc; break; case "DescCreateDateTime": options.OrderByType = OrderByType.CreateDateDesc; break; } result = houseService.Search(options); model.Regions = regionService.GetAll(4); model.Houses = result.Houses; return(View(model)); }
public ActionResult AdvanceretSoeg(Models.SearchViewModel SoegResulta, string soegetxt, int?PrisFra, int?PrisTil, string region, string radiobtn1, string radiobtn2) { if (soegetxt != "") { SoegResulta.Events = db.EventsTbs.Where(i => i.EventTitle.Contains(soegetxt) && i.Pris >= PrisFra && i.Pris <= PrisTil && i.Region == region).ToList(); } else if (PrisFra >= 0 && PrisTil < 100000000) { SoegResulta.Events = db.EventsTbs.Where(p => p.Pris >= PrisFra && p.Pris <= PrisTil && p.Region == region).ToList(); } else if (region != "") { SoegResulta.Events = db.EventsTbs.Where(p => p.Region == region).ToList(); } return(View(SoegResulta)); }