// GET: PurchaseCar
 public ActionResult Index()
 {
     if (Session["has_login"] == null)
     {
         if (Session["ReturnToPurchaseCar"] == null)
         {
             Session["ReturnToPurchaseCar"] = "true";
         }
         else
         {
             Session["ReturnToPurchaseCar"] = null;
         }
         return(Redirect("/Login"));
     }
     else
     {
         Session.Remove("ReturnToPurchaseCar");
         ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
         var pcar_list = memberPurchase.getPurchaseCarList(Session["mem_phone"].ToString()).Select(pcar_info => new MemberPurchaseCarViewModel()
         {
             goods_id       = pcar_info.goods_id,
             goods_num      = pcar_info.goods_num,
             goods_name     = memberPurchase.getGoods(pcar_info.goods_id).goods_name,
             goods_img_path = memberPurchase.getGoods(pcar_info.goods_id).goods_img_path,
             unit_price     = memberPurchase.getGoods(pcar_info.goods_id).goods_price,
             total_price    = memberPurchase.getGoods(pcar_info.goods_id).goods_price *pcar_info.goods_num,
         }).ToList();
         var resView = new MemberPurchaseCarViewModel()
         {
             mem_phone = Session["mem_phone"].ToString(),
             pcar_list = pcar_list,
         };
         return(View(resView));
     }
 }
Exemple #2
0
 // GET: BuyGoods
 public ActionResult Index()
 {
     if (ControllerContext.RouteData.GetRequiredString("id") == null)
     {
         return(Redirect("/Home"));
     }
     //if (ControllerContext.RouteData.GetRequiredString("id") == null) return HttpNotFound();
     else
     {
         string now_goods_id = ControllerContext.RouteData.GetRequiredString("id");
         ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
         var goods_list = memberPurchase.getGoodsList().Select(goods_info => new MemberPurchaseCarViewModel()
         {
             goods_id       = goods_info.goods_id,
             goods_name     = goods_info.goods_name,
             goods_img_path = goods_info.goods_img_path,
             unit_price     = goods_info.goods_price,
         }).ToList();
         var now_img_list = memberPurchase.getGoodsImgs(now_goods_id).Select(img_info => new GoodsImgView()
         {
             img_path = img_info.img_path,
         }).ToList();
         var resView = new PurchaseHomeTotalInfo()
         {
             now_goods_id         = now_goods_id,
             now_goods_name       = memberPurchase.getGoods(now_goods_id).goods_name,
             now_goods_unit_price = memberPurchase.getGoods(now_goods_id).goods_price,
             now_goods_detail     = memberPurchase.getGoods(now_goods_id).goods_details,
             total_goods_list     = goods_list,
             now_img_lists        = now_img_list,
         };
         return(View(resView));
     }
 }
Exemple #3
0
 // GET: WishList
 public ActionResult Index()
 {
     if (Session["has_login"] == null)
     {
         if (Session["ReturnToWishList"] == null)
         {
             Session["ReturnToWishList"] = "true";
         }
         else
         {
             Session["ReturnToWishList"] = null;
         }
         return(Redirect("/Login"));
     }
     else
     {
         Session.Remove("ReturnToWishList");
         ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
         var wish_list = memberPurchase.getWishLists(Session["mem_phone"].ToString()).Select(wish_info => new MemberWishListViewModel()
         {
             goods_id         = wish_info.goods_id,
             goods_name       = memberPurchase.getGoods(wish_info.goods_id).goods_name,
             goods_unit_price = memberPurchase.getGoods(wish_info.goods_id).goods_price,
             goods_img_path   = memberPurchase.getGoods(wish_info.goods_id).goods_img_path,
         }).ToList();
         var resView = new MemberWishListViewModel()
         {
             mem_phone  = Session["mem_phone"].ToString(),
             wish_lists = wish_list,
         };
         return(View(resView));
     }
 }
        public ActionResult Search(MemberPurchaseListViewModel memberPurchaseListViewModel)
        {
            if (memberPurchaseListViewModel == null)
            {
                return(Redirect("/Error"));
            }
            string search_id = memberPurchaseListViewModel.search_id;
            string mem_phone = Session["mem_phone"].ToString();

            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            if (search_id == null)
            {
                var p_list = memberPurchase.getPurchaseLists(mem_phone).Select(p_info => new MemberPurchaseListViewModel()
                {
                    plist_id       = p_info.plist_id,
                    goods_id       = p_info.goods_id,
                    goods_name     = p_info.goods_name,
                    goods_img_path = memberPurchase.getGoods(p_info.goods_id).goods_img_path,
                    goods_num      = p_info.goods_num,
                    date           = p_info.date,
                    unit_price     = p_info.unit_price,
                    total_price    = p_info.total_price,
                }).ToList();
                var resView = new MemberPurchaseListViewModel()
                {
                    mem_phone      = mem_phone,
                    purchase_lists = p_list,
                };
                return(PartialView("PlistPart1", resView));
            }
            else
            {
                var p_list = memberPurchase.getPurchaseListsBySearchId(mem_phone, search_id).Select(p_info => new MemberPurchaseListViewModel()
                {
                    plist_id       = p_info.plist_id,
                    goods_id       = p_info.goods_id,
                    goods_name     = p_info.goods_name,
                    goods_img_path = memberPurchase.getGoods(p_info.goods_id).goods_img_path,
                    goods_num      = p_info.goods_num,
                    date           = p_info.date,
                    unit_price     = p_info.unit_price,
                    total_price    = p_info.total_price,
                }).ToList();
                var resView = new MemberPurchaseListViewModel()
                {
                    mem_phone      = mem_phone,
                    purchase_lists = p_list,
                };
                return(PartialView("PlistPart1", resView));
            }
        }
 // GET: PurchaseCar
 public ActionResult Index()
 {
     if (Session["has_login"] == null)
     {
         if (Session["ReturnToPurchaseCar"] == null)
         {
             Session["ReturnToPurchaseCar"] = "true";
         }
         else
         {
             Session["ReturnToPurchaseCar"] = null;
         }
         return(Redirect("/Login"));
     }
     else
     {
         Session.Remove("ReturnToPurchaseCar");
         string phone    = Session["mem_phone"].ToString();
         string nowdir   = savepath + phone + @"\";
         string nowpath1 = nowdir + @"alipay_coder.jpg";
         string nowpath2 = nowdir + @"weixin_coder.jpg";
         if (System.IO.File.Exists(nowpath1))
         {
             System.IO.File.Delete(nowpath1);
         }
         if (System.IO.File.Exists(nowpath2))
         {
             System.IO.File.Delete(nowpath2);
         }
         ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
         var pcar_list = memberPurchase.getPurchaseCarList(phone).Select(pcar_info => new MemberPurchaseCarViewModel()
         {
             goods_id       = pcar_info.goods_id,
             goods_num      = pcar_info.goods_num,
             goods_name     = memberPurchase.getGoods(pcar_info.goods_id).goods_name,
             goods_img_path = memberPurchase.getGoods(pcar_info.goods_id).goods_img_path,
             unit_price     = memberPurchase.getGoods(pcar_info.goods_id).goods_price,
             total_price    = memberPurchase.getGoods(pcar_info.goods_id).goods_price *pcar_info.goods_num,
             sell_stock     = memberPurchase.getGoods(pcar_info.goods_id).goods_stock,
         }).ToList();
         var resView = new MemberPurchaseCarViewModel()
         {
             mem_phone = phone,
             pcar_list = pcar_list,
         };
         return(View(resView));
     }
 }
Exemple #6
0
        public ActionResult Index(MemberPurchaseCarViewModel memberPurchaseCarViewModels, string[] selected)
        {
            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            ShopBusinessLogic.LoginMember    loginMember    = new ShopBusinessLogic.LoginMember();
            var submit_list  = memberPurchaseCarViewModels.select_list;
            var select_list  = new List <AccountModels>();
            var address_list = loginMember.ShowMemberAddress(Session["mem_phone"].ToString()).Select(address_info => new MemberAddress()
            {
                address     = address_info.address,
                address_tag = address_info.address_tag,
            }).ToList();
            float all_price = 0;

            for (int i = 0; i < submit_list.Count; ++i)
            {
                if (selected[i] != null && selected[i] == "on")
                {
                    var item = new AccountModels()
                    {
                        goods_id    = submit_list[i].goods_id,
                        goods_name  = memberPurchase.getGoods(submit_list[i].goods_id).goods_name,
                        goods_num   = submit_list[i].goods_num,
                        unit_price  = memberPurchase.getGoods(submit_list[i].goods_id).goods_price,
                        total_price = memberPurchase.getGoods(submit_list[i].goods_id).goods_price *submit_list[i].goods_num,
                    };
                    if (item.goods_num > 0)
                    {
                        all_price += item.total_price;
                        select_list.Add(item);
                    }
                }
            }
            var resView = new AccountModels()
            {
                mem_phone       = Session["mem_phone"].ToString(),
                addresses       = address_list,
                accountModeList = select_list,
                all_price       = all_price,
            };

            Session["has_pay"] = "true";
            return(View(resView));
        }
        // GET: PurchaseList

        public ActionResult Index()
        {
            if (Session["has_login"] == null)
            {
                if (Session["ReturnToPurchaseList"] == null)
                {
                    Session["ReturnToPurchaseList"] = "true";
                }
                else
                {
                    Session["ReturnToPurchaseList"] = null;
                }
                return(Redirect("/Login"));
            }
            else
            {
                Session.Remove("ReturnToPurchaseList");
                string phone    = Session["mem_phone"].ToString();
                string nowdir   = savepath + phone + @"\";
                string nowpath1 = nowdir + @"alipay_coder.jpg";
                string nowpath2 = nowdir + @"weixin_coder.jpg";
                if (System.IO.File.Exists(nowpath1))
                {
                    System.IO.File.Delete(nowpath1);
                }
                if (System.IO.File.Exists(nowpath2))
                {
                    System.IO.File.Delete(nowpath2);
                }
                ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
                var p_list = memberPurchase.getPurchaseLists(phone).Select(p_info => new MemberPurchaseListViewModel()
                {
                    plist_id       = p_info.plist_id,
                    goods_id       = p_info.goods_id,
                    goods_name     = p_info.goods_name,
                    goods_img_path = memberPurchase.getGoods(p_info.goods_id).goods_img_path,
                    goods_num      = p_info.goods_num,
                    date           = p_info.date,
                    unit_price     = p_info.unit_price,
                    total_price    = p_info.total_price,
                }).ToList();
                var resView = new MemberPurchaseListViewModel()
                {
                    mem_phone      = phone,
                    purchase_lists = p_list,
                };
                //return PartialView("PlistPart1", resView);
                return(View(resView));
            }
        }
Exemple #8
0
        public ActionResult Index(int DeleteWishId)
        {
            Session.Remove("ReturnToWishList");
            string mem_phone = Session["mem_phone"].ToString();
            int    goods_id  = DeleteWishId;

            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            memberPurchase.deleteWishList(mem_phone, goods_id);
            var wish_list = memberPurchase.getWishLists(Session["mem_phone"].ToString()).Select(wish_info => new MemberWishListViewModel()
            {
                goods_id         = wish_info.goods_id,
                goods_name       = memberPurchase.getGoods(wish_info.goods_id).goods_name,
                goods_unit_price = memberPurchase.getGoods(wish_info.goods_id).goods_price,
                goods_img_path   = memberPurchase.getGoods(wish_info.goods_id).goods_img_path,
            }).ToList();
            var resView = new MemberWishListViewModel()
            {
                mem_phone  = Session["mem_phone"].ToString(),
                wish_lists = wish_list,
            };

            return(PartialView("WishListPart1", resView));
        }
Exemple #9
0
        public ActionResult Index()
        {
            string now_goods_id = Request.QueryString["goods_id"];

            ShopBusinessLogic.LoginMember loginMember = new ShopBusinessLogic.LoginMember();
            ShopBusinessLogic.SellerSell  sellerSell  = new ShopBusinessLogic.SellerSell();
            if (now_goods_id == null)
            {
                return(Redirect("/Error"));
            }
            if (!sellerSell.isInGoodsList(Convert.ToInt32(now_goods_id)))
            {
                return(Redirect("/Error"));
            }
            else
            {
                int now_goods_id_int = Convert.ToInt32(now_goods_id);
                ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
                var goods_list = memberPurchase.getGoodsList().Select(goods_info => new MemberPurchaseCarViewModel()
                {
                    goods_id       = goods_info.goods_id,
                    goods_name     = goods_info.goods_name,
                    goods_img_path = goods_info.goods_img_path,
                    unit_price     = goods_info.goods_price,
                    sell_stock     = goods_info.goods_stock,
                    sell_volume    = goods_info.goods_volume,
                    seller_phone   = goods_info.seller_phone,
                }).ToList();
                var now_img_list = memberPurchase.getGoodsImgs(now_goods_id_int).Select(img_info => new GoodsImgView()
                {
                    img_path = img_info.img_path,
                }).ToList();
                var now_goods = memberPurchase.getGoods(now_goods_id_int);
                var resView   = new PurchaseHomeTotalInfo()
                {
                    now_goods_id         = now_goods_id_int,
                    now_goods_name       = now_goods.goods_name,
                    now_goods_unit_price = now_goods.goods_price,
                    now_goods_detail     = now_goods.goods_details,
                    now_stock            = now_goods.goods_stock,
                    now_volume           = now_goods.goods_volume,
                    now_seller_phone     = now_goods.seller_phone,
                    now_seller_name      = loginMember.GetMemberByPhone(now_goods.seller_phone).mem_name,
                    now_goods_tag        = now_goods.goods_tag,
                    total_goods_list     = goods_list,
                    now_img_lists        = now_img_list,
                };
                return(View(resView));
            }
        }
        public ActionResult  Index(string DeletePcarId)
        {
            Session.Remove("ReturnToPurchaseCar");
            string mem_phone = Session["mem_phone"].ToString();

            ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
            memberPurchase.deletePurchaseCar(mem_phone, DeletePcarId);
            var pcar_list = memberPurchase.getPurchaseCarList(Session["mem_phone"].ToString()).Select(pcar_info => new MemberPurchaseCarViewModel()
            {
                goods_id       = pcar_info.goods_id,
                goods_num      = pcar_info.goods_num,
                goods_name     = memberPurchase.getGoods(pcar_info.goods_id).goods_name,
                goods_img_path = memberPurchase.getGoods(pcar_info.goods_id).goods_img_path,
                unit_price     = memberPurchase.getGoods(pcar_info.goods_id).goods_price,
                total_price    = memberPurchase.getGoods(pcar_info.goods_id).goods_price *pcar_info.goods_num,
            }).ToList();
            var resView = new MemberPurchaseCarViewModel()
            {
                mem_phone = Session["mem_phone"].ToString(),
                pcar_list = pcar_list,
            };

            return(View(resView));
        }
        // GET: PurchaseList

        public ActionResult Index()
        {
            if (Session["has_login"] == null)
            {
                if (Session["ReturnToPurchaseList"] == null)
                {
                    Session["ReturnToPurchaseList"] = "true";
                }
                else
                {
                    Session["ReturnToPurchaseList"] = null;
                }
                return(Redirect("/Login"));
            }
            else
            {
                Session.Remove("ReturnToPurchaseList");
                ShopBusinessLogic.MemberPurchase memberPurchase = new ShopBusinessLogic.MemberPurchase();
                var p_list = memberPurchase.getPurchaseLists(Session["mem_phone"].ToString()).Select(p_info => new MemberPurchaseListViewModel()
                {
                    plist_id       = p_info.plist_id,
                    goods_id       = p_info.goods_id,
                    goods_name     = p_info.goods_name,
                    goods_img_path = memberPurchase.getGoods(p_info.goods_id).goods_img_path,
                    goods_num      = p_info.goods_num,
                    date           = p_info.date,
                    unit_price     = p_info.unit_price,
                    total_price    = p_info.total_price,
                }).ToList();
                var resView = new MemberPurchaseListViewModel()
                {
                    mem_phone      = Session["mem_phone"].ToString(),
                    purchase_lists = p_list,
                };
                //return PartialView("PlistPart1", resView);
                return(View(resView));
            }
        }