public ActionResult OrdersManagement() { if (Session["UserId"] == null || Session["IsAdmin"].ToString() == "1") return RedirectToAction("Login", "Account"); Utilities.Shop _ShopUtility = new Utilities.Shop(); List<Models.Shop> Shopslist = new List<Models.Shop>(); Shopslist = _ShopUtility.GetAllShops(); return View(Shopslist); }
// GET: Order public ActionResult AddOrder() { if (Session["UserId"] == null) return RedirectToAction("Login", "Account"); Utilities.Shop _ShopUtility = new Utilities.Shop(); List<Models.Shop> Shopslist = new List<Models.Shop>(); Shopslist = _ShopUtility.GetAllShops(); return View(Shopslist); }
public ActionResult ViewAllShops() { if (Session["UserId"] == null || Session["IsAdmin"].ToString() == "1") { return(RedirectToAction("Login", "Account")); } Utilities.Shop _ShopUtility = new Utilities.Shop(); List <Models.Shop> Shopslist = new List <Models.Shop>(); Utilities.User _UserUtility = new Utilities.User(); List <Models.ShopAdditionalInfo> ShopAdditionalInfoList = new List <Models.ShopAdditionalInfo>(); Shopslist = _ShopUtility.GetAllShops(); foreach (Models.Shop shop in Shopslist) { Models.ShopAdditionalInfo shopAdditionalInfo = new Models.ShopAdditionalInfo(); shopAdditionalInfo.Id = shop.Id; shopAdditionalInfo.Name = shop.Name; shopAdditionalInfo.ShopArea = shop.ShopArea; shopAdditionalInfo.Image = shop.Image; shopAdditionalInfo.Notes = shop.Notes; if (shop.Status == "active") { shopAdditionalInfo.Status = "card-success"; } else { shopAdditionalInfo.Status = "card-danger"; } shopAdditionalInfo.CreatedDate = shop.CreatedDate; shopAdditionalInfo.ModifiedDate = shop.ModifiedDate; shopAdditionalInfo.MobileNumber = shop.MobileNumber; shopAdditionalInfo.MaxOrderCount = shop.MaxOrderCount; shopAdditionalInfo.TodaysOderCount = shop.TodaysOderCount; shopAdditionalInfo.UserInfo = _UserUtility.GetShopConnectedUserInfo(shop.Id); ShopAdditionalInfoList.Add(shopAdditionalInfo); } return(View(ShopAdditionalInfoList)); }
public ActionResult GetAllShops() { Dictionary <string, object> returnObject = new Dictionary <string, object>(); try { List <Models.Shop> ShopsList = new List <Models.Shop>(); ShopsList = _shopData.GetAllShops(); if (ShopsList != null) { returnObject.Add("ShopsList", ShopsList); returnObject.Add("status", "success"); } else { returnObject.Add("status", "fail"); } } catch (Exception) { } return(Json(new { message = returnObject }, JsonRequestBehavior.AllowGet)); }