// // GET: /ProductMenuType/ public ActionResult Index(string name, string id, string Type, string peopleCount, string orderid = null, string MemberCardNo = null) { List <ProductType> pt = null; // object obj = System.Web.HttpRuntime.Cache.Get("ProductType" + ProductTypeId); // if (obj != null) //{ // p = obj as List<ProductMenuType>; // } // if (p == null) //{ // string RestaurantId = "3F5A7C2E-0B48-4738-B4D0-3848FE943913"; ProductTypeModel ptm = new ProductTypeModel(); pt = ptm.getProductType(id); // System.Web.HttpRuntime.Cache.Add("ProductType" + ProductTypeId, p, null, DateTime.Now.AddHours(2), // TimeSpan.Zero, CacheItemPriority.Normal, null); // } ViewBag.SourceAccountId = name; ViewBag.RestaurantId = id; ViewBag.Type = Type; ViewBag.peopleCount = peopleCount; ViewBag.MemberCardNo = MemberCardNo; ViewBag.orderid = orderid; return(View(pt)); }
// // GET: /ProductType/ public ActionResult Index(string SourceAccountId, string RestaurantId, string Status = null, string Date = null, string Time = null, string Type = null, string IsOrder = null, string MemberCardNo = null, string Orderid = null) { Session["SourceAccountId"] = SourceAccountId; ProductTypeModel ptm = new ProductTypeModel(); if (Date != null & Time != null) { if (Time.Equals("0")) { DateTime data = Convert.ToDateTime(Date); data = data.AddHours(9); ViewBag.BookTime = data; } else if (Time.Equals("1")) { DateTime data = Convert.ToDateTime(Date); data = data.AddHours(16); ViewBag.BookTime = data; } } if (!string.IsNullOrEmpty(IsOrder) && IsOrder == "1" && !string.IsNullOrEmpty(Orderid)) { OrderDetailsModel odm = new OrderDetailsModel(); OrderModel om = new OrderModel(); int i; i = odm.EmptyOrderDetails(MemberCardNo, Orderid); i = om.EmptyOrderStatus(Orderid); i = om.EmptyOrder(Orderid); } List <ProductType> pt = null; if (!string.IsNullOrEmpty(RestaurantId)) { if (RestaurantId.ToUpper() == "0E71D411-EFE0-4964-8E3D-2901E0823815") { List <ProductType> onept = ptm.getOneProductType(RestaurantId); ViewBag.FirstMenus = onept; if (onept != null && onept.Count() > 0) { pt = ptm.getProductTypebyId(RestaurantId, onept.First().TypeId.ToString()); } } else { pt = ptm.getProductType(RestaurantId); } } Session["begindm"] = RestaurantId; string RestaurantId1 = Session["begindm"] != null ? Session["begindm"].ToString() : ""; ViewBag.SourceAccountId = SourceAccountId; ViewBag.Status = Status; ViewBag.FastFood = Type; ViewBag.RestaurantId = RestaurantId; ViewBag.MemberCardNo = MemberCardNo; ViewBag.OrderId = Orderid; return(View(pt ?? new List <ProductType>())); }