public ActionResult MarkItemAsNotFound(NotFoundViewModel model) { if (ModelState.IsValid == false) { ModelState.AddModelError("forError", "Form hatalı."); return View("NotFound", model); } OrderItemDO orderItem = CheckoutBL.GetOrderItemById(model.OrderItem.ID); if (model.Barcode.Trim() != orderItem.Barcode) { base.SetErrorMessage("Barkod numarası bu ürünle uyuşmuyor. Barkod: " + model.Barcode + " Ürün Barkodu: " + orderItem.Barcode); model.OrderItem = CheckoutBL.GetDetailedOrderItemById(model.OrderItem.ID); return View("NotFound", model); } else { switch (model.OrderItem.NotFoundReasonText) { case "Stok Yok": if (SupplyRuleEngine.CanUserMarkAsStockout() == false) { ModelState.AddModelError("CheckoutStockoutError", "Bu işlem için yetkiniz yoktur."); return View("NotFound", model); } break; case "Diğer Mağazaya Aktar": if (SupplyRuleEngine.CanUserMarkAsTransferToOtherStores() == false) { ModelState.AddModelError("CheckoutTransferToOtherStoresError", "Bu işlem için yetkiniz yoktur."); return View("NotFound", model); } break; } CollectionDataBL.AddOrderItemToNotFoundList(model.OrderItem, model.LocationID, base.UserID); base.SetSuccessMessage("Bulunamadı olarak işaretlendi."); } return RedirectToAction("List"); }
public ActionResult MarkItemAsNotFound(int id, int locationId) { OrderItemDO orderItem = CheckoutBL.GetDetailedOrderItemById(id); NotFoundViewModel model = new NotFoundViewModel { LocationID = locationId, OrderItem = orderItem }; return View("NotFound", model); }