public ActionResult GetCustomerAddress()
        {
            if (HttpContext.Request.Cookies[StaticLicense.LicName + "Active"] != null)
            {
                string     SSSession = "";
                HttpCookie cookie    = HttpContext.Request.Cookies.Get(StaticLicense.LicName + "Active");
                if (cookie != null)
                {
                    Encryption ENC = new Encryption();
                    SSSession = ENC.DecryptText(cookie.Value, "OMD_Token");
                    ActivationModel act = JsonConvert.DeserializeObject <ActivationModel>(SSSession);

                    PDBC db = new PDBC("PandaMarketCMS", true);
                    db.Connect();
                    List <ExcParameters> parss = new List <ExcParameters>();

                    D_APIModelFiller DMF = new D_APIModelFiller();
                    return(Json(DMF.CustomerAddresses(Convert.ToInt32(act.CustomerId))));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            else
            {
                return(Content("Login"));
            }
        }
Пример #2
0
        public ActionResult ShoppingCart(int factorId)
        {
            D_APIModelFiller DMF = new D_APIModelFiller();
            var model            = new ShoppingCartModelView()
            {
                FactorModel = DMF.shoppingCart(factorId),
                Ostan       = DMF.Ostanha()
            };

            return(View(model));
        }
Пример #3
0
        public ActionResult AboutUs()
        {
            D_APIModelFiller DMF = new D_APIModelFiller();
            var model            = new AboutUsModelView()
            {
                CompanyCustomers = DMF.CompanyCustomers(),
                TeamMembers      = DMF.TeamMembers()
            };

            return(View(model));
        }
Пример #4
0
        public ActionResult City(string Cat, int Id = 0)
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            if (Cat == "City")
            {
                return(Json(DMF.City(Id)));
            }
            else
            {
                return(Json(DMF.Ostanha()));
            }
        }
Пример #5
0
        public ActionResult Product_Detail(int Id)
        {
            if (HttpContext.Request.Cookies[StaticLicense.LicName + "Factor"] != null)
            {
                string     SSSession = "";
                HttpCookie cookie    = HttpContext.Request.Cookies.Get(StaticLicense.LicName + "Factor");
                if (cookie != null)
                {
                    Encryption ENC = new Encryption();
                    SSSession = ENC.DecryptText(cookie.Value, "OMD_FACTOR");
                    MiniFactorModel   minif  = JsonConvert.DeserializeObject <MiniFactorModel>(SSSession);
                    D_APIModelFiller  dmf    = new D_APIModelFiller();
                    FactorPopUpModel  FPM    = dmf.shoppingCart(minif.Id);
                    FactorMasterModel modell = new FactorMasterModel()
                    {
                        ListOfProducts = FPM,
                        Totality       = minif
                    };
                    ViewBag.factorMasterModel = modell;
                }
                else
                {
                    ViewBag.factorMasterModel = null;
                }
            }
            else
            {
                ViewBag.factorMasterModel = null;
            }

            D_APIModelFiller DMF = new D_APIModelFiller();
            var model            = new ProductDetail_ModelView()
            {
                ProductModel = DMF.SingleProduct(Id, "Ago"),
                Company      = DMF.CompanyCustomers()
            };

            model.RelatedProducts = DMF.ProductList(15, "گروه اصلی", model.ProductModel.SubCatId, 1, "", "Ago");
            return(View(model));
        }
Пример #6
0
        public ActionResult ShoppingCartPopup(int factorId)
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            return(View(DMF.shoppingCart(factorId)));
        }
Пример #7
0
        public ActionResult Product_List(string Type, int Id = 0, int Page = 1, string Search = "", int CustomerId = 0)
        {
            if (HttpContext.Request.Cookies[StaticLicense.LicName + "Factor"] != null)
            {
                string     SSSession = "";
                HttpCookie cookie    = HttpContext.Request.Cookies.Get(StaticLicense.LicName + "Factor");
                if (cookie != null)
                {
                    Encryption ENC = new Encryption();
                    SSSession = ENC.DecryptText(cookie.Value, "OMD_FACTOR");
                    MiniFactorModel   minif  = JsonConvert.DeserializeObject <MiniFactorModel>(SSSession);
                    D_APIModelFiller  dmf    = new D_APIModelFiller();
                    FactorPopUpModel  FPM    = dmf.shoppingCart(minif.Id);
                    FactorMasterModel modell = new FactorMasterModel()
                    {
                        ListOfProducts = FPM,
                        Totality       = minif
                    };
                    ViewBag.factorMasterModel = modell;
                }
                else
                {
                    ViewBag.factorMasterModel = null;
                }
            }
            else
            {
                ViewBag.factorMasterModel = null;
            }
            D_APIModelFiller DMF  = new D_APIModelFiller(4);
            D_APIModelFiller DMF2 = new D_APIModelFiller();
            var model             = new D_ProductList_ModelView()
            {
                Cateqories    = DMF.CategoriesAsTree_OneSub("MainCat", 1),
                NewProducts   = DMF.ChosenProducts("New", 3, "Ago"),
                Sale_Products = DMF.ChosenProducts("Sale", 3, "Ago"),
                ProductsG3    = DMF.ChosenProducts("MainTag", 3, "Ago", 1),
                thisPage      = Page,
                Cat           = Type,
                Search        = Search,
                CatId         = Id
            };

            if (Type == "پرفروش ها")
            {
                model.Products = DMF.ChosenProducts("Sale", 15, "Ago");
                model.Pages    = 1;
            }
            else if (Type == "جدیدترین")
            {
                model.Products = DMF.ChosenProducts("New", 15, "Ago");
                model.Pages    = 1;
            }
            else if (Type == "فروش ویژه")
            {
                model.Products = DMF.ChosenProducts("MainTag", 15, "Ago", 1);
                model.Pages    = 1;
            }
            else if (Type == "علاقه مندی ها")
            {
                model.Products = DMF2.FavoriteProducts(15, Type, Id, Page, Search, "Date", CustomerId);
                model.Pages    = DMF2.ProList_Pages(Type, 15, Id, Search, CustomerId);
            }
            else
            {
                model.Products = DMF2.ProductList(15, Type, Id, Page, Search, "Date");
                model.Pages    = DMF2.ProList_Pages(Type, 15, Id, Search);
            }



            if (Type == "گروه اصلی")
            {
                model.tags = DMF2.ProductTags("Sub", Id);
            }
            else
            {
                model.tags = DMF2.ProductTags("min", 0);
            }
            return(View(model));
        }
Пример #8
0
        public ActionResult TagsFiller()
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            return(Json(DMF.ProductTags("tag", 0)));
        }
Пример #9
0
        public ActionResult Category(string Cat, int Id = 0)
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            return(Json(DMF.Categories(Cat, Id)));
        }
Пример #10
0
        public ActionResult GetMPCs(int id)
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            return(Json(DMF.MPCs(id)));
        }
Пример #11
0
        public ActionResult MasterTags()
        {
            D_APIModelFiller DMF = new D_APIModelFiller();

            return(Json(DMF.ProductTags("min", 0)));
        }