public ActionResult customerProfileReturn()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            ///این متغیر پر بشه
            int CustomerId = 1009;

            return(View(modelFiller.Customers_Factors("تکمیل نشده", CustomerId, "Date")));
        }
Exemple #2
0
        public ActionResult factor()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            ///این متغیر پر بشه
            int CustomerId = 1009;

            return(View(modelFiller.Customers_Factors("همه", CustomerId, "Date")));
        }
        public ActionResult AboutUs()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();

            var ModelView = new AboutUsModelView()
            {
                CustomerMessages = modelFiller.CompanyCustomers(),
                TeamMembers      = modelFiller.TeamMembers()
            };

            return(View(ModelView));
        }
Exemple #4
0
        public ActionResult productpage(int ProId)
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            ///این متغیرها پر بشه

            var model = new ProductDetail_ModelView()
            {
                ProductModel  = modelFiller.SingleProduct(ProId, "Ago"),
                Sale_Products = modelFiller.ChosenProducts("Sale", 4, "Ago")
            };


            return(View(model));
        }
        // GET: CustomerSide_Pages
        public ActionResult index()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller(4);
            var ModelView = new IndexPageModelView()
            {
                NewProducts      = modelFiller.ChosenProducts("New", 10, "Ago"),
                Sale_Products    = modelFiller.ChosenProducts("Sale", 4, "Ago"),
                ProductsG3       = modelFiller.ChosenProducts("MainTag", 3, "Ago", 1),
                SelectedProducts = modelFiller.ProductList(20, "همه", 0, 1, "", "Date")
            };


            return(View(ModelView));
        }
        public ActionResult CustomerProfile(int id)
        {
            PDBC db         = new PDBC();
            var  AddresList = new List <AddressModel>();

            db.Connect();
            DataTable dt1 = db.Select("SELECT DISTINCT  B.[Ostan_name]  , B.[Shahr_Name] as city ,[C_AddressHint],[C_FullAddress] FROM [tbl_Customer_Address] as A inner join [tbl_Enum_Shahr] as B on A.ID_Shahr=B.ID_Shahr where A.id_Customer=" + id);

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                var model = new AddressModel()
                {
                    Num         = i + 1,
                    Ostan       = dt1.Rows[i]["Ostan_name"].ToString(),
                    City        = dt1.Rows[i]["city"].ToString(),
                    FullAddress = dt1.Rows[i]["C_FullAddress"].ToString(),
                    HintAddress = dt1.Rows[i]["C_AddressHint"].ToString()
                };
                AddresList.Add(model);
            }

            DataTable dt = db.Select("SELECT [id_Customer],[C_regDate],[C_Mobile],[C_FirstName],[C_LastNAme],[C_Description],[C_Email] FROM [tbl_Customer_Main]where id_Customer=" + id);

            db.DC();
            var res = new Admin_CustomerDetail();

            if (dt.Rows.Count != 0)
            {
                res.Id           = Convert.ToInt32(dt.Rows[0]["id_Customer"]);
                res.Name         = dt.Rows[0]["C_FirstName"].ToString();
                res.Familly      = dt.Rows[0]["C_LastNAme"].ToString();
                res.Discription  = dt.Rows[0]["C_Description"].ToString();
                res.PhoneNum     = dt.Rows[0]["C_Mobile"].ToString();
                res.Email        = dt.Rows[0]["C_Email"].ToString();
                res.registerDate = DateConvert.DateReturner(dt.Rows[0]["C_regDate"].ToString(), "ShortDate");
                res.Addresses    = AddresList;
            }

            CustomerModelFiller modelFiller = new CustomerModelFiller();

            CustomerProfileModelView Model = new CustomerProfileModelView()
            {
                CustomerModel = res,
                OstanHa       = modelFiller.Ostanha()
            };



            return(View(Model));
        }
        public ActionResult customerProfile()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            tbl_Customer_Main   tcm         = new tbl_Customer_Main();
            var coockie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerCode());

            if (coockie != null)
            {
                tcm = CoockieController.SayWhoIsHE(coockie.Value);
                var Id = tcm.id_Customer;
                return(View(modelFiller.customerDetail(Convert.ToInt32(Id))));
            }
            else
            {
                return(Content("Error"));
            }
        }
Exemple #8
0
        public ActionResult search(string Type, int Id = 0, int Page = 1, string Search = "")
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();

            ///این متغیر پر بشه
            int CustomerId = 1009;
            var model      = new SearchPageModelView()
            {
                Cat        = Type,
                CatId      = Id,
                Cateqories = modelFiller.CategoriesAsTree_OneSub("MainCat", 1),
                thisPage   = Page,
                Search     = Search
            };

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


            return(View(model));
        }
Exemple #9
0
        public ActionResult customershoppingCart()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            tbl_Customer_Main   tcm         = new tbl_Customer_Main();

            if (HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerCode()) != null)
            {
                var coockie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerCode());
                tcm = CoockieController.SayWhoIsHE(coockie.Value);
            }
            else
            {
                return(RedirectToAction("loginandregister", "CustomerSide_Register"));
            }
            int CustomerId = Convert.ToInt32(tcm.id_Customer);

            if (HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerShoppingBasket()) != null)
            {
                var coockie = JsonConvert.DeserializeObject <ShoppingBasket>(HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerShoppingBasket()).Value);
                var model   = new ShoppingCartModelView()
                {
                    FactorModel = modelFiller.shoppingCart(coockie),
                    Ostan       = modelFiller.Ostanha(),
                    Adresses    = modelFiller.CustomerAddresses(CustomerId),
                    Customer    = modelFiller.customerDetail(CustomerId)
                };

                FactorPopUpModel fpm = model.FactorModel;
                var userCookieIDV    = new HttpCookie(ProjectProperies.CustomerShoppingFactor());
                userCookieIDV.Value   = CoockieController.SetCustomerShopFactorCookie(fpm);
                userCookieIDV.Expires = DateTime.Now.AddDays(2);
                Response.SetCookie(userCookieIDV);
                return(View(model));
            }
            else
            {
                return(RedirectToAction("index", "CustomerSide_Pages"));
            }
        }
        public ActionResult customerProfileAddress()
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();
            tbl_Customer_Main   tcm         = new tbl_Customer_Main();
            var coockie = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerCode());

            if (coockie != null)
            {
                tcm = CoockieController.SayWhoIsHE(coockie.Value);
                var Id    = tcm.id_Customer;
                var model = new customerAddressModelView()
                {
                    City      = modelFiller.Ostanha(),
                    Addresses = modelFiller.CustomerAddresses(Convert.ToInt32(Id))
                };


                return(View(model));
            }
            else
            {
                return(Content("Error"));
            }
        }
Exemple #11
0
        public ActionResult GetMPCs(int id)
        {
            CustomerModelFiller DMF = new CustomerModelFiller();

            return(Json(DMF.MPCs(id)));
        }
        public ActionResult City(int OstanId)
        {
            CustomerModelFiller modelFiller = new CustomerModelFiller();

            return(Json(modelFiller.City(OstanId)));
        }