public IHttpActionResult UpdatePalletProducts(PalletProductsSyncCollection palletProductCollection) { var terminal = TerminalServices.GetTerminalBySerial(palletProductCollection.SerialNo); if (terminal == null) { return(Unauthorized()); } var TransactionLog = TerminalServices.CheckTransactionLog(palletProductCollection.TransactionLogId, terminal.TerminalId); if (TransactionLog == true) { return(Conflict()); } foreach (var item in palletProductCollection.PalletProducts) { var result = _palletService.AddFulFillmentPalletProduct(AutoMapper.Mapper.Map <PalletProductsSync, PalletProductAddViewModel>(item)); if (result != null && result.PalletProductID > 0) { item.PalletProductID = result.PalletProductID; item.PostedSuccess = true; } } return(Ok(palletProductCollection)); }
public ActionResult AddProcessedProductsToPallet(PalletProductAddViewModel model) { model.DateCreated = DateTime.UtcNow; model.CreatedBy = CurrentUserId; var item = _palletingService.AddFulFillmentPalletProduct(model); return(Json(item.PalletProductID, JsonRequestBehavior.AllowGet)); }