public IActionResult Create() { var orders = _productOrderManager.GetAll(); var model = new ProductOrderVM(); return(View(model)); }
public IActionResult Create([Bind("OrderId,ProductId,Status,Quantity,Unit,Product,Order")] ProductOrderVM model) { // model.OrderNo = if (ModelState.IsValid) { var productOrder = _mapper.Map <ProductOrder>(model); bool isAdded = _productOrderManager.Add(productOrder); if (isAdded) { ViewBag.SuccessMessage = "ProductOrder Saved Successfully!"; } } else { ViewBag.ErrorMessage = "Operation Failed!"; } var productorders = _productOrderManager.GetAll(); return(View("Index", productorders)); }