Ejemplo n.º 1
0
        public ActionResult Detail(int id)
        {
            _productID = id;
            ProductDao pDao = new ProductDao();
            Product    p    = pDao.FindProductByICode(id);

            ProductImageDao           iDao      = new ProductImageDao();
            IQueryable <ProductImage> listImage = iDao.FindImage(id);

            ViewBag.Image = listImage;

            IQueryable <CF_Products_Categories> listCF_P_Cat = pDao.Find_CF_Product_Categories(id);

            ViewBag.CF_Category = listCF_P_Cat;

            ProductDao         pdDao      = new ProductDao();
            List <ViewProduct> listImage2 = pdDao.ListViewProduct(10);

            ViewBag.ViewNewsProduct2 = listImage2;

            CategoryDao           cDao      = new CategoryDao();
            IQueryable <Category> listCates = cDao.ListCategory();

            ViewBag.Category = listCates;

            CommentDao         cmDao       = new CommentDao();
            List <ViewComment> listComment = cmDao.ListComment(id);

            ViewBag.Comment = listComment;

            return(View(p));
        }
Ejemplo n.º 2
0
        public UnitOfWork(IDbConnection connection)
        {
            _connection = connection;

            StoredProcedures          = new StoredProcedures(connection);
            Brands                    = new BrandDao(connection);
            Carts                     = new CartDao(connection);
            Categories                = new CategoryDao(connection);
            CategoryProducts          = new CategoryProductDao(connection);
            ContactInfo               = new ContactInfoDao(connection);
            Characteristics           = new CharacteristicDao(connection);
            CharacteristicProducts    = new CharacteristicProductDao(connection);
            FavouriteProducts         = new FavouriteProductDao(connection);
            Items                     = new ItemDao(connection);
            OptionalParameters        = new OptionalParameterDao(connection);
            OptionalParameterProducts = new OptionalParameterProductDao(connection);
            Orders                    = new OrderDao(connection);
            OrderDeliveryTypes        = new OrderDeliveryTypeDao(connection);
            OrderPaymentTypes         = new OrderPaymentTypeDao(connection);
            OrderProducts             = new OrderProductDao(connection);
            OrderStatuses             = new OrderStatusDao(connection);
            Products                  = new ProductDao(connection);
            ProductImages             = new ProductImageDao(connection);
            Roles                     = new RoleDao(connection);
            SupportMessages           = new SupportMessageDao(connection);
            Users                     = new UserDao(connection);
        }
Ejemplo n.º 3
0
        public ActionResult Details(int id)
        {
            ProductDao pDao = new ProductDao();
            Product    p    = pDao.FindProductByICode(id);

            ProductImageDao           iDao      = new ProductImageDao();
            IQueryable <ProductImage> listImage = iDao.FindImage(id);

            ViewBag.Image = listImage;

            IQueryable <CF_Products_Categories> listCF_P_Cat = pDao.Find_CF_Product_Categories(id);

            ViewBag.CF_Category = listCF_P_Cat;

            CategoryDao           cDao      = new CategoryDao();
            IQueryable <Category> listCates = cDao.ListCategory();

            ViewBag.Category = listCates;
            return(View(p));
        }