コード例 #1
0
        public ActionResult SearchProduct(SearchInCategory srcPrd)
        {
            ViewBag.Title = "Axtarış";
            List <StockUser> stkFind = db.searchProduct(srcPrd);

            homeView.AdminPanel          = db.getAdminPanel();       //Navbar menu
            homeView.SubProductsCategory = db.getSubProducts();      //Menu Categoriya
            homeView.ProductsCategorys   = db.getProductsCategory(); //Menu Sub categoriya
            topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
            homeView.TopSlidePruduct = topProduct;
            homeView.StockList       = stkFind;
            homeView.FooterList      = db.getFooters();
            homeView.SocialMediaList = db.getSocialMedia();
            homeView.FeedbackEmail   = db.getContactList().FirstOrDefault().Email;
            if (srcPrd != null && stkFind.Count != 0)
            {
                return(View(homeView));
            }
            else
            {
                ViewBag.Result    = "Sorğu üzrə “" + srcPrd.ProductName + "” heç nә tapılmadı";
                ViewBag.SubResult = "Sorğunu dәyişdirmәk üçün cәhd edin vә ya mәhsul kataloqundan istifadә edin";
                return(View(homeView));
            }
        }
コード例 #2
0
 public ActionResult GetProductDetail(int id)
 {
     if (id != 0)
     {
         SubImgAndDet subImgAndDet = new SubImgAndDet(new List <SlideMod>(db.getSlideList(id)), new List <ProductDetail>(db.getProductDetail(id)));
         if (subImgAndDet.SubDetail.Count != 0 && subImgAndDet.SubSlide.Count != 0)
         {
             homeView.AdminPanel          = db.getAdminPanel();
             homeView.SubProductsCategory = db.getSubProducts();
             homeView.ProductsCategorys   = db.getProductsCategory();
             topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
             homeView.TopSlidePruduct   = topProduct;
             homeView.FooterList        = db.getFooters();
             homeView.SubImageAndDetail = subImgAndDet;
             homeView.FeedbackEmail     = db.getContactList().FirstOrDefault().Email;
             homeView.SocialMediaList   = db.getSocialMedia();
             Stock slctdStc = db.getStock(id);
             slctdStc.Quantity      = 1;
             homeView.SelectedStock = slctdStc;
             return(View(homeView));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     else
     {
         return(HttpNotFound());
     }
 }
コード例 #3
0
 public ActionResult GetProduct(int id)
 {
     ViewBag.Title                = "Məhsullar";
     homeView.AdminPanel          = db.getAdminPanel();       //Navbar menu
     homeView.SubProductsCategory = db.getSubProducts();      //Menu Categoriya
     homeView.ProductsCategorys   = db.getProductsCategory(); //Menu Sub categoriya
     topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
     homeView.TopSlidePruduct = topProduct;
     homeView.StockList       = db.getStockWherePrd(id);
     homeView.FooterList      = db.getFooters();
     homeView.SocialMediaList = db.getSocialMedia();
     homeView.FeedbackEmail   = db.getContactList().FirstOrDefault().Email;
     return(View(homeView));
 }
コード例 #4
0
 public ActionResult GetLocation()
 {
     ViewBag.Title                = "Xəritə";
     homeView.ContactList         = db.getContactList();
     homeView.AdminPanel          = db.getAdminPanel();
     homeView.SubProductsCategory = db.getSubProducts();
     homeView.ProductsCategorys   = db.getProductsCategory();
     topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
     homeView.TopSlidePruduct = topProduct;
     homeView.FooterList      = db.getFooters();
     homeView.SocialMediaList = db.getSocialMedia();
     homeView.FeedbackEmail   = db.getContactList().FirstOrDefault().Email;
     return(View(homeView));
 }
コード例 #5
0
 public ActionResult Index()
 {
     ViewBag.Title                = "Allin.az:Elektronika və məişət texnika internet mağazası";
     homeView.AdminPanel          = db.getAdminPanel();
     homeView.SubProductsCategory = db.getSubProducts();
     homeView.ProductsCategorys   = db.getProductsCategory();
     topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
     homeView.TopSlidePruduct = topProduct;
     homeView.FooterList      = db.getFooters();
     homeView.SocialMediaList = db.getSocialMedia();
     homeView.FeedbackEmail   = db.getContactList().FirstOrDefault().Email;
     homeView.MainSlideList   = db.getMainSlide();
     homeView.StockList       = db.weekDiscount();
     ViewBag.Category         = new SelectList(homeView.ProductsCategorys, "Id", "ProductName");
     return(View(homeView));
 }
コード例 #6
0
        public ActionResult GetCart()
        {
            HttpCookie cookieInBrowser = Request.Cookies["ProductListCookie"];

            ViewBag.Title                = "Səbət";
            homeView.AdminPanel          = db.getAdminPanel();
            homeView.SubProductsCategory = db.getSubProducts();
            homeView.ProductsCategorys   = db.getProductsCategory();
            topProduct = new TopProductSlide(db.getStockStrNewTop(), db.getStockStrEndirimTop(), ranProduct.getNewStockList(db.getStockStrList()));
            homeView.TopSlidePruduct = topProduct;
            homeView.FooterList      = db.getFooters();
            homeView.SocialMediaList = db.getSocialMedia();
            homeView.FeedbackEmail   = db.getContactList().FirstOrDefault().Email;
            if (cookieInBrowser != null)
            {
                string[]     cookieSplit = cookieInBrowser["id"].Split(',');
                List <Stock> stockList   = new List <Stock>();
                int          convertedId;
                bool         viewResult = false;
                for (int i = 0; i < cookieSplit.Length - 1; i += 2)
                {
                    bool result = int.TryParse(cookieSplit[i], out convertedId);
                    if (result)
                    {
                        Stock selectedStock = db.getStock(Convert.ToInt32(cookieSplit[i]));
                        selectedStock.Quantity = Convert.ToInt32(cookieSplit[i + 1]);
                        stockList.Add(selectedStock);
                        viewResult = true;
                    }
                    else
                    {
                        homeView.FeedBackMessage = "Xəta";
                        break;
                    }
                }
                if (viewResult)
                {
                    homeView.StockIdList = stockList;
                }
            }
            else
            {
                homeView.FeedBackMessage = "Sizin səbət artıq boşdur";
            }
            return(View(homeView));
        }