Beispiel #1
0
 public Form1()
 {
     InitializeComponent();
     ViewOrSearch();
     Clear();
     // iproduct = _iproduct;
     ListProduct = manage.GetAllProducts();
 }
Beispiel #2
0
        public List <Product> GetAllProducts(int id)
        {
            using CrmDbContext db = new CrmDbContext();
            ProductManagement prodMangr = new ProductManagement(db);

            return(prodMangr.GetAllProducts());
        }
        public void ReadProductsSucces()
        {
            ProductManagement productManagement = new ProductManagement();
            List <Product>    products          = BindProducts();

            productManagement.CreateProduct(products);
            //var productManagement = new ProductManagement();
            var productsReaded = productManagement.GetAllProducts();

            Assert.True(productsReaded);
        }
        public ActionResult Search(string filter = null)
        {
            IList <Product> prod = null;

            if (string.IsNullOrEmpty(filter))
            {
                prod = ProductManagement.GetAllProducts();
            }
            else
            {
                prod = ProductManagement.GetAllProducts().Where(x => x.Title == filter || x.Description.Contains(filter)).ToList();
            }

            return(View(prod));
        }
Beispiel #5
0
        // GET: Product
        public ActionResult Index()
        {
            List <ProductDO> products = productManagement.GetAllProducts();

            var query = from p in products
                        select new ProductListViewModel
            {
                Product_ID       = p.Product_ID,
                Product_Name     = p.Product_Name,
                Price            = Convert.ToInt32(p.Price),
                SubCategory_Name = p.SubCategory.SubCategory_Name,
                Brand_Name       = p.Brand.Brand_Name,
                Size             = p.Size,
                Color            = p.Color,
                Product_Image    = p.Product_Image,
                //ImageFile = "\\Images" + "\\" + p.Product_Image.ToString(),
                Description = p.Description,
                Quantity    = Convert.ToInt32(p.Quantity),
                //UpdatedDate = Convert.ToDateTime(p.UpdatedDate)
            };

            return(View(query.ToList()));
        }
 // GET: Product
 public ActionResult Index()
 {
     return(View(ProductManagement.GetAllProducts()));
 }