// 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));
     }
 }
 // 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));
     }
 }
        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));
        }