Exemple #1
0
        public ActionResult ProductDetail(int id, string index)
        {
            DataSet  ds       = _productDa.GetProductById(id);
            Products products = (Products)CBO.FillObjectFromDataSet(ds, typeof(Products));

            return(View(products));
        }
Exemple #2
0
        public IActionResult GetProductById(int id)
        {
            var res = _pro.GetProductById(id);

            if (res != null)
            {
                return(Ok(res));
            }
            else
            {
                return(BadRequest(new { message = "Product not found" }));
            }
        }
Exemple #3
0
 public ProductBE GetProductById(int id)
 {
     try
     {
         return(objProductDA.GetProductById(id));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public ActionResult EditProduct(int id)
        {
            if (DataMemory.CurrentUser == null)
            {
                return(RedirectToAction("Logout", "Admin"));
            }
            var product = (Products)CBO.FillObjectFromDataSet(_productDa.GetProductById(id), typeof(Products));

            ViewBag.GroupProduct = GetGroupProduct();
            return(View("~/Areas/Admin/Views/Product/EditProduct.cshtml", product));
        }
Exemple #5
0
        public void TestGetProductById()
        {
            var obj = objProductDA.GetProductById(1);

            Assert.Equals(obj.Price, 199);
        }
        public ActionResult Details(int id)
        {
            Product p = ProductDA.GetProductById(id);

            return(View(p));
        }