示例#1
0
        public async Task <IActionResult> Create(int itemOfProductId)
        {
            var itemOfProduct = await _repository.GetItemOfProduct(itemOfProductId);

            if (itemOfProduct == null)
            {
                ViewBag.ErrorMessage = "لايوجد   بيانات";
                return(View("NotFound"));
            }
            ViewBag.ItemOfProductId   = itemOfProduct.Id;
            ViewBag.ItemOfProductName = itemOfProduct.Name;
            return(View());
        }
示例#2
0
        public async Task <IActionResult> Edit(int id)
        {
            var itemOfProduct = await _repository.GetItemOfProduct(id);

            if (itemOfProduct == null)
            {
                ViewBag.ErrorMessage = "لايوجد   بيانات";
                return(View("NotFound"));
            }

            ViewData["TypeOfProductId"] = new SelectList(await _repository.GetTypeOfProducts(), "Id", "Name", itemOfProduct.Id);

            return(View(itemOfProduct));
        }