/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult City(string id) { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); CommonDomainLogic _commonDomainLogic = new CommonDomainLogic(); ChooseCity chooseCity = new ChooseCity(); if (!string.IsNullOrEmpty(id)) { Guid _cityguid = _commonDomainLogic.FindCityGuid(id); UserDomainLogic _userDomainLogic = new UserDomainLogic(); _userDomainLogic.UpdatePreferedCity(_cityguid); chooseCity.Cities = _commonDomainLogic.GetCityByGUID(_cityguid); chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } else { chooseCity.Cities = _commonDomainLogic.GetCities(); chooseCity.SelectedCity = new City { CityName = chooseCity.Cities.FirstOrDefault().CityName, CityGuid = chooseCity.Cities.FirstOrDefault().CityGuid, CityUrlName = chooseCity.Cities.FirstOrDefault().CityUrlName }; } return(View("ListRestaurants", restaurantDomainLogic.GetRestaurantsByCity(chooseCity.SelectedCity))); }
/// <summary> /// /// </summary> /// <param name="ItemGuid"></param> /// <returns></returns> public ActionResult AddItem(Nullable <Guid> ItemGuid) { ViewBag.PopupTitle = "Item Detail"; RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); return(PartialView("_AddItem", restaurantDomainLogic.GetMenuItem(ItemGuid))); }
/// <summary> /// /// </summary> /// <param name="restaurant"></param> /// <returns></returns> public ActionResult MyRestaurant(Restaurant restaurant) { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); BusinessObject restaurantSearch = new BusinessObject(); restaurantSearch = restaurantDomainLogic.GetRestaurantByRestaurantGuid(new Guid("C37FB6CE-E2F5-4893-BB92-21136A3E5756")); return(View(restaurantSearch)); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult MerchantMenuItems() { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); Nullable <Guid> RestaurantGuid = new Guid("7B9D0CFF-F15F-49CA-95EF-EA81CDEA4E34"); List <Items> itemslist = new List <Items>(); itemslist = restaurantDomainLogic.GetMerchantItems(RestaurantGuid.HasValue ? RestaurantGuid.Value : Guid.Empty); return(View(itemslist)); }
public ActionResult AddEditItem(Items Item) { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); if (ModelState.IsValid) { if (restaurantDomainLogic.AddEditItem(Item)) { TempData["IspopUp"] = true; } } ViewBag.PopupTitle = "Item Detail"; return(PartialView("_AddItem", restaurantDomainLogic.GetMenuItem(Item.ItemGuid))); }
public ActionResult UploadMenuItemImage(FormCollection frm) { if (Request.Files.Count > 0) { try { string imageName = ""; if (Request.Files.Count > 0) { RestaurantDomainLogic restaurantDomainLogic = new RestaurantDomainLogic(); imageName = restaurantDomainLogic.UploadMenuItemImage(Request); } return(Json(new { NewImage = imageName, Message = "File uploaded successfully", IsSuccess = true })); } catch (Exception ex) { return(Json(new { NewImage = "", Message = "Error occurred. Error details: " + ex.Message, IsSuccess = false })); } } else { return(Json(new { NewImage = "", Message = "No image selected.", IsSuccess = false })); } }
public ActionResult UpdateRestaurentProfile(BusinessObject BusinessObject) { RestaurantDomainLogic restaurantDomailLogic = new RestaurantDomainLogic(); return(Json(restaurantDomailLogic.UpdateRestaurantProfile(BusinessObject), JsonRequestBehavior.AllowGet)); }