예제 #1
0
        public ActionResult Create()
        {
            ProductManagerViewModel viewModel = new ProductManagerViewModel();

            viewModel.Product           = new Product();
            viewModel.ProductCategories = productCategories.Collection();
            return(View(viewModel));
        }
        public ActionResult Create()
        {
            ViewModelProductManager viewModel = new ViewModelProductManager();

            viewModel.Product           = new ModelProduct();
            viewModel.ProductCategories = cRepositoryCategories.Collection();
            return(View(viewModel));
        }
예제 #3
0
        public ActionResult Create()                                            // method to create  product - displays page to fill in product details
        {
            ProductManagerViewModel viewModel = new ProductManagerViewModel();

            viewModel.Product           = new Product();
            viewModel.ProductCategories = productCategories.Collection();


            return(View(viewModel));
        }
예제 #4
0
        public ActionResult Create()
        {
            // Before we are passing  only Product as shown below
            //=============================================================
            //Product MyProduct = new Product();
            //return View(MyProduct );
            //=============================================================
            // but now we make a view model whcih contains one Product data
            // and collection of Product Catagories table data
            // and we are now passing this view model to Create Class
            ProductandCatagoryViewModel MyViewModel = new ProductandCatagoryViewModel();

            MyViewModel.Product           = new Product();                   // we are passing one record of Product
            MyViewModel.ProductCatagories = ProdCatagRepositry.Collection(); // we are passing collection of Product Catagory to view
            return(View(MyViewModel));
        }
예제 #5
0
        // GET: productManager
        public ActionResult Index()
        {
            List <Product> products = context.Collection().ToList();

            return(View(products));
            //   return View
        }
        // GET: ProductManager
        public ActionResult Index()
        {
            //List<ProductCatagory> MyProductCatagory = MyProdCatagoryRep.Collection().ToList();
            List <ProductCatagory> MyProductCatagory = MyProdCatagoryRep.Collection().ToList();

            return(View(MyProductCatagory));
        }
예제 #7
0
        public async Task <List <CoffeeModel> > Handle(CoffeeListQuery request, CancellationToken cancellationToken)
        {
            var items = await _repository.Collection();

            if (!items.Any())
            {
                throw new Exception($"No Items were found");
            }

            return(items);
        }
예제 #8
0
        // GET: ProductCategoryManager
        public ActionResult Index()
        {
            List <ProductCategory> productCategories = context.Collection().ToList();

            return(View(productCategories));
        }
예제 #9
0
        // GET: ProductManager
        public ActionResult Index()
        {
            List <Product> MyProduct = MyProdRep.Collection().ToList();

            return(View(MyProduct));
        }
        public ActionResult Index()
        {
            List <ModelProduct> ltProducts = cRepositoryProducts.Collection().ToList();

            return(View(ltProducts));
        }
        // GET: ProductCategoryManager
        public ActionResult Index()
        {
            List <ProductCategory> category = contextCategory.Collection().ToList();

            return(View(category));
        }