Esempio n. 1
0
        //
        // GET: /Stage/
        public ActionResult Index(string id, string name)
        {
            ViewBag.SourceAccountId = name;
            ViewBag.CompanyId = id;
            Session["CompanyId"] = id;
            ProductModel pm = new ProductModel();
               string RestaurantId = "3F5A7C2E-0B48-4738-B4D0-3848FE943913";

            List<RandomProduct> list = pm.getRandomProduct(id,"1");
            Session["begindm"] = RestaurantId;
            return View(list);
        }
Esempio n. 2
0
        public JsonResult getRandomProduct(string RestaurantId ,string peopleCount )
        {
            ProductModel pm = new ProductModel();
               // string CompanyId = Session["CompanyId"] != null ? Session["CompanyId"].ToString() : "";
            List<RandomProduct> list = pm.getRandomProduct(RestaurantId, peopleCount);

            JsonResult json = new JsonResult
            {
                Data = list
            };
            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许get访问,否则报错
            return json;
        }
Esempio n. 3
0
 public JsonResult getNextAutoProducts(string CompanyId,string peopleCount)
 {
     ProductModel pm = new ProductModel();
        // string CompanyId = Session["CompanyId"] != null ? Session["CompanyId"].ToString() : "";
     List<AutoProducts> list = pm.getAutoRandomProducts(CompanyId, peopleCount);
     ViewBag.ProductCount = list.Count();
     JsonResult json = new JsonResult
     {
         Data = list
     };
     json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;//允许get访问,否则报错
     return json;
 }
Esempio n. 4
0
        //
        // GET: /Product/
        public ActionResult getProductByProductTypeId(string RestaurantId, string ProductTypeId, string SourceAccountId, string Status, string Type = null)
        {
            List<ProductNew> p = null;
            //object obj = System.Web.HttpRuntime.Cache.Get("ProductType" + ProductTypeId);

            //if (obj != null)
            //{
            //    p = obj as List<ProductNew>;
            //}
            //if (p == null)
            //{
            ProductModel pm = new ProductModel();
            p = pm.getProductByProductTypeId(RestaurantId, ProductTypeId);
            //  System.Web.HttpRuntime.Cache.Add("ProductType" + ProductTypeId, p, null, DateTime.Now.AddHours(2),
            //  TimeSpan.Zero, CacheItemPriority.Normal, null);
            //}
            CrmMemberModel cdb = new CrmMemberModel();
            if (SourceAccountId != null && SourceAccountId != "")
            {
                List<CrmMember> crm = cdb.getCrmMemberListInfoData(SourceAccountId);
                ViewBag.MemberCardNo = crm.First().Uid;
                string MemberCardNo = crm.First().Uid;
                OrderModel odm = new OrderModel();
                Order order = null;
                Order FastFoodOrder = null;
                //Type == "FastFood"表明此店为快餐店。
                if (!string.IsNullOrEmpty(Type) && Type == "FastFood")
                {

                    FastFoodOrder = odm.SelectUnFinishedFastFoodOrder(crm.First().Uid);
                }
                else
                {
                    order = odm.SelectUnFinishedOrder(crm.First().Uid);
                }

                string OrderId = "";
                if (order != null || FastFoodOrder != null)
                {
                    OrderId = order != null ? order.Id.ToString() : FastFoodOrder.Id.ToString();
                    ViewBag.OrderId = OrderId;
                    /* 显示用户已点菜数量*/
                    MyMenuModel myMenu = new MyMenuModel();
                    List<MyMenu> mymenu = myMenu.getMyMenuListData(MemberCardNo, OrderId, Type);
                    ViewBag.MyMenuListData = mymenu;
                }
            }
            ViewBag.Status = Status;
            return View(p);
        }
Esempio n. 5
0
 public ActionResult getMemProducts(string id, string name)
 {
     ProductModel p = new ProductModel();
     ViewBag.Uid = name;
     ViewBag.CompanyId = id;
     List<MemProduct> result = p.getMemProducts(id);
     ViewBag.PrepayAccount = 0;
     CrmMemberModel cdb = new CrmMemberModel();
     List<CrmMember> crm = cdb.getCrmMemberListInfoData(name);
     if (crm.Count() > 0)
     {
         decimal dec = cdb.GetPrepayAccount(crm.First().Uid).AccountMoney;
         ViewBag.PrepayAccount = dec;
     }
     return View(result);
 }
        public ActionResult stage2(string RestaurantId, string ProductTypeId, string TypeName, string SourceAccountId, string Status, string Type = null, string imgid = null, string peopleCount=null)
        {
            List<ProductNew> p = null;
            object obj = System.Web.HttpRuntime.Cache.Get("ProductType" + ProductTypeId);

            if (obj != null)
            {
                p = obj as List<ProductNew>;
            }
            if (p == null)
            {
                ProductModel pm = new ProductModel();
                p = pm.getProductByProductTypeId(RestaurantId, ProductTypeId);
                System.Web.HttpRuntime.Cache.Add("ProductType" + ProductTypeId, p, null, DateTime.Now.AddHours(2),
                TimeSpan.Zero, CacheItemPriority.Normal, null);
            }
            CrmMemberModel cdb = new CrmMemberModel();
            List<CrmMember> crm = cdb.getCrmMemberListInfoData(SourceAccountId);
            ViewBag.MemberCardNo = crm.First().Uid;
            ViewBag.TypeName = TypeName;
            ViewBag.Type = Type;
            ViewBag.imgid = imgid;
            ViewBag.peopleCount = peopleCount;
            ViewBag.SourceAccountId = SourceAccountId;
            ViewBag.RestaurantId = RestaurantId;
            /* 显示用户已点菜数量*/
            OrderModel odm = new OrderModel();
            Order FastFoodOrder = null;
            ViewBag.OrderId = null;
            FastFoodOrder = odm.SelectUnFinishedFastFoodOrder(crm.First().Uid);
            if ( FastFoodOrder != null)
            {
                if (Type == "Auto") { Type = "FastFood"; }

                string OrderId =FastFoodOrder.Id.ToString();
                ViewBag.OrderId = FastFoodOrder.Id;
                /* 显示用户已点菜数量*/
                MyMenuModel myMenu = new MyMenuModel();
                List<MyMenu> myAutoMenu = myMenu.getMyMenuListData(crm.First().Uid, OrderId, Type);
                ViewBag.MyAutoMenuListData = myAutoMenu;
            }
            return View(p);
        }
Esempio n. 7
0
        public FileContentResult getImageProductMenu(string id)
        {
            if (!string.IsNullOrEmpty(id))
            {
                ProductModel rm = new ProductModel();
                List<ProductMenu> list = rm.getImageProductMenu(id);
                if (list != null && list.Count > 0)
                {
                    ProductMenu info = list.First();
                    if (info != null)
                    {
                        if (info.ThumbImage != null)
                        {
                            return File(info.ThumbImage, "jpg", "image_" + id + ".jpg");
                        }

                    }

                }
            }
            return File(new byte[] { }, "jpg", "image_" + id + ".jpg");
        }