public ActionResult AddEditItem(int parentId, int id) { var model = new EditPurchaseOrderDetailTempViewModel(); model.PurchaseOrderDetailTemp = PurchasingService.FindPurchaseOrderDetailTempModel(id, CurrentCompany, true); model.PurchaseOrderDetailTemp.PurchaseOrderHeaderTempId = parentId; prepareEditModel(model, parentId); model.LGS = PurchasingService.LockPurchaseOrderDetailTemp(model.PurchaseOrderDetailTemp); return(View("AddEditItem", model)); }
public void FindPurchaseOrderDetailTempModelTest() { var testUser = GetTestUser(); var testCompany = GetTestCompany(testUser, true); var testPurchase = GetTestPurchaseOrderHeader(testCompany, testUser, 1); var pohtModel = PurchasingService.CopyPurchaseOrderToTemp(testCompany, testPurchase, testUser); var model = PurchasingService.FindPurchaseOrderDetailTempsListModel(testCompany.Id, pohtModel.Id, 0, 1, PageSize, ""); var newItem = createPurchaseOrderDetailTemp(model); var error = PurchasingService.InsertOrUpdatePurchaseOrderDetailTemp(newItem, testUser, ""); Assert.IsTrue(!error.IsError, $"Error: {error.Message}"); var test = PurchasingService.FindPurchaseOrderDetailTempModel(newItem.Id, null, false); AreEqual(model, test); }