private OrderArtCL checkoutOrderArt(string ident, ReservdelCL res, Decimal coNumber) { ServHuvSrc.COrderArt coa = new ServHuvSrc.COrderArt(); OrderArtCL oa = new OrderArtCL(); oa.Artnr = res.Artnr; oa.VartOrdernr = res.VartOrdernr; oa.CoAntal = coNumber; oa = coa.checkoutOrderArt(ident, oa); return(oa); }
private ErrorCL checkOutIfNeeded(string ident, ReservdelCL res) { ErrorCL err = new ErrorCL(); err.ErrCode = 0; err.ErrMessage = ""; Decimal onOrder = 0; Decimal outChecked = 0; if (isDotArticle(res.Artnr)) { return(err); } string errStr = ""; int kategori = getArtKat(res.Artnr, ref errStr); if (kategori != 1) { return(err); } if (errStr == "") { onOrder = countArtOnOrder(res, ref errStr); } if (errStr == "") { outChecked = countOutchecked(res, ref errStr); } if (errStr != "") { err.ErrMessage = errStr; if (err.ErrMessage != "") { err.ErrCode = 13101; } return(err); } if (onOrder > outChecked) { OrderArtCL oaCL = checkoutOrderArt(ident, res, onOrder - outChecked); if (oaCL.ErrCode != 0) { err.ErrMessage = oaCL.ErrMessage; err.ErrCode = oaCL.ErrCode; return(err); } // Added 2018-08-27. Reservdel shall now be confirmed in Pyramid if (!res.getFromCS) { List <ArticleCommit.CArticleCommitData> acList = new List <ArticleCommit.CArticleCommitData>(); ArticleCommit.CArticleCommitData ac = new ArticleCommit.CArticleCommitData(); ac.articleNumber = res.Artnr; ac.orderNumber = res.VartOrdernr; ac.quantity = onOrder - outChecked; ac.orderArtID = oaCL.OrderArtId; acList.Add(ac); ArticleCommit.CArticleCommit acCommit = new ArticleCommit.CArticleCommit(); err = acCommit.generateFile(acList, "1"); //ac.sav } // Removed 2018-08-27 and replaced by the code above. //if (!res.getFromCS) //{ // CompactStore.updateOAStorageData data = new CompactStore.updateOAStorageData(); // data.orderArtId = oaCL.OrderArtId; // //data.stockToSend = Convert.ToInt32(oaCL.OrdAntal); // data.stockToSend = res.Antal; // data.error = ""; // CompactStore.CCompactStore cs = new CompactStore.CCompactStore(); // string result = cs.updateDbWithoutSend(data, "x"); //} } return(err); }
public OrderArtCL checkoutOrderArt(string ident, OrderArtCL oa) { ServHuvSrc.COrderArt coa = new ServHuvSrc.COrderArt(); return(coa.checkoutOrderArt(ident, oa)); }