Ejemplo n.º 1
0
        // GET: Seller/Acount
        public ActionResult Dashboard()
        {
            if (Session["userID"] != null)
            {
                // kiem tra co phai nhan viên cửa hàng
                if (Convert.ToInt32(Session["roleID"]) != 4)
                {
                    return(View("Login"));
                }
                else if (Convert.ToInt32(Session["roleID"]) == 4)
                {
                    Session["userID"] = 2;
                }
                ProductsClient CC      = new ProductsClient();
                int            Storeid = CC.Storeid(Convert.ToInt32(Session["userID"]));

                //kiem tra role nhan vien thi dang nhap trang shop cua admin
                //if (Convert.ToInt32(Session["role"]) == 4)
                //{
                //    Storeid = CC.Storeid(Convert.ToInt32(Session["AdminShop"]));
                //}

                ViewBag.listProducts = CC.findAll(Storeid);
                return(View());
            }

            else
            {
                return(View("Login"));
            }
        }
        // GET: Seller/Products
        public ActionResult Index()
        {
            ViewBag.MaintypeID = new SelectList(db.Main_Type, "ID", "Name");
            ViewBag.TypeID     = new SelectList(db.Product_Type, "TypeID", "Name");



            ProductsClient CC      = new ProductsClient();
            int            Storeid = CC.Storeid(Convert.ToInt32(Session["userID"]));

            ViewBag.listProducts = CC.findAll(Storeid);



            return(View());
        }