예제 #1
0
        public ActionResult Info(int sellerId, int productId)
        {
            string      msg;
            ProductInfo productInfo = null;
            BuyerInfo   user        = Session["User"] as BuyerInfo;

            if (user == null)
            {
                return(View(productInfo));
            }

            productInfo = ProductInfoBll.GetModel(sellerId, productId, out msg);


            var list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId);


            BuyerProductView productInfo1 = list.FirstOrDefault(p => p.ProductId == productId);

            if (productInfo == null)
            {
                productInfo = new ProductInfo()
                {
                    ProductFullName = "商品信息有误"
                }
            }
            ;


            return(View(productInfo));
        }
예제 #2
0
        public PartialViewResult GetCategorysProduct(int sellerId = 0, int classId = 0)
        {
            List <BuyerProductView> productViews = new List <BuyerProductView>();


            BuyerInfo user = Session["User"] as BuyerInfo;

            if (user == null)
            {
                return(PartialView(productViews));
            }

            List <BuyerProductView> list = new List <BuyerProductView>();

            if (classId == 0)
            {
                list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId);
            }
            else
            {
                ViewBag.SelectType = "class";
                list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId, classId);
            }



            return(PartialView(list));
        }
예제 #3
0
        // GET: Goods
        public ActionResult List(int sellerId = -1, int classId = 0)
        {
            if (sellerId < 0)
            {
                try
                {
                    sellerId = Convert.ToInt32(Session["SellerId"]);
                    classId  = Convert.ToInt32(Session["ClassId"]);
                }
                catch (Exception ex)
                {
                    ViewBag.SellerName = "获取商家信息失败";
                }
            }

            Session["SellerId"] = sellerId;
            Session["ClassId"]  = classId;

            string msg;

            ViewBag.SellerId   = sellerId;
            ViewBag.SelectType = "";

            var seller = SellerInfoBll.GetModel(sellerId, out msg);

            if (seller == null)
            {
                ViewBag.SellerName = "获取商家信息失败";
            }
            else
            {
                ViewBag.SellerName = seller.CompanyName;
            }


            var user = GetUser();

            if (user == null)
            {
                return(RedirectToAction("Login", "Login"));
            }



            List <BuyerProductView> list = new List <BuyerProductView>();

            if (classId == 0)
            {
                list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId);
            }
            else
            {
                ViewBag.SelectType = "class";
                list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId, classId);
            }

            return(View(list));
        }
예제 #4
0
        public PartialViewResult GetCategorysProduct(int sellerId = 0, int classId = 0)
        {
            BuyerInfo user = Session["User"] as BuyerInfo;

            if (user == null)
            {
                return(PartialView("NeedLogin"));
            }

            var list = BuyerInfoBll.GetBuyerProductView(user.BuyerId, sellerId, classId);

            return(PartialView(list));
        }
예제 #5
0
 public void GetBuyerProductViewTest()
 {
     var list = BuyerInfoBll.GetBuyerProductView(1000016, 10005);
 }