public ActionResult searchInBusinessTable(string searchKeyWord, String ColummName, string type) { IQueryable <buisinessInformation> searchresult = db.buisinessInformations; if (ColummName == "bname") { searchresult = searchresult.Where(e => e.bname.Contains(searchKeyWord)); } if (ColummName == "location") { Int64 Zipcode; if (Int64.TryParse(searchKeyWord, out Zipcode)) { var zc = Zipcode.ToString(); searchresult = searchresult.Where(e => e.zipCode.Contains(zc)); } else { searchresult = searchresult.Where(e => e.City.Contains(searchKeyWord)); } } var searchresult_ = searchresult.Select(e => new { e.bname, e.City }).ToList(); return(Json(searchresult_, JsonRequestBehavior.AllowGet)); }
public ActionResult partial_buisinessInformation(string type, string location, string name) { IQueryable <buisinessInformation> buisinessInformations = db.buisinessInformations.OrderByDescending(e => e.createdDate); if (type == "Promo Screen") { buisinessInformations = buisinessInformations.Where(e => e.isScreenPrinter == true); } else if (type == "Promo Embroiders") { buisinessInformations = buisinessInformations.Where(e => e.isEmbroiders == true); } if (name != "") { buisinessInformations = db.buisinessInformations.Where(e => e.bname.Contains(name)); } if (location != "") { Int64 Zipcode; if (Int64.TryParse(location, out Zipcode)) { var zc = Zipcode.ToString(); buisinessInformations = db.buisinessInformations.Where(e => e.zipCode.Contains(zc)); } else { buisinessInformations = db.buisinessInformations.Where(e => e.City.Contains(location)); } } var buisinessInformations_ = buisinessInformations.ToList(); ViewBag.serviceList = db.buisinessServices.Include(e => e.service).OrderBy(e => e.service.ServiceName).ToList(); return(PartialView("partial_buisinessInformation", buisinessInformations_)); }
// Will only return a string containing the Restaurant's address public string FullAddress() { StringBuilder restString = new StringBuilder(); restString.Append(Address + " "); restString.Append(City + " "); restString.Append(State + " "); restString.Append(Zipcode.ToString() + " "); return(restString.ToString()); }
public override string ToString() { StringBuilder restString = new StringBuilder(); restString.Append(Name + " "); restString.Append(Address + " "); restString.Append(City + " "); restString.Append(State + " "); restString.Append(Zipcode.ToString() + " "); restString.Append(Rating.ToString() + " "); return(restString.ToString()); }