public static bool TransferToGunRoom(List <TransferItemVO> mdseToTransfer, out int transferNumber, string carrier, out string errorMessage, string gunFacilityName) { errorMessage = ""; transferNumber = 0; string errorCode = ""; icn = new List <string>(); icnQty = new List <string>(); gunNumber = new List <string>(); gunType = new List <string>(); if (mdseToTransfer.Count > 0) { foreach (TransferItemVO transfermdse in mdseToTransfer) { storeNumber = transfermdse.StoreNumber; icn.Add(transfermdse.ICN); icnQty.Add(transfermdse.ICNQty); custNumber = transfermdse.CustomerNumber; tranDate = transfermdse.TransactionDate; mrDate = transfermdse.MdseRecordDate; mrTime = transfermdse.MdseRecordTime; mrUser = transfermdse.MdseRecordUser; mrDesc = transfermdse.MdseRecordDesc; mrChange = transfermdse.MdseRecordChange; mrType = transfermdse.MdseRecordType; classcode = transfermdse.ClassCode; acctNum = transfermdse.AcctNumber; createdBy = transfermdse.CreatedBy; gunNumber.Add(transfermdse.GunNumber); gunType.Add(transfermdse.GunType); } if (icn.Count > 0) { //Make the db call for transfer GlobalDataAccessor.Instance.beginTransactionBlock(); /* storeNumber will be value from last item being transferred (set in foreach loop above), * but all items should be coming FROM the same store. */ if (TransfersDBProcedures.ExecuteTransferOutOfStore(storeNumber, icn, icnQty, custNumber, tranDate, mrDate, mrTime, mrUser, mrDesc, mrChange, mrType, classcode, acctNum, createdBy, gunNumber, gunType, 0, 0, 0, gunFacilityName, true, out transferNumber, carrier, out errorCode, out errorMessage)) { GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.COMMIT); if (transferNumber > 0 && errorCode == "0") { return(true); } } else { FileLogger.Instance.logMessage(LogLevel.ERROR, null, errorMessage); errorMessage = "Gun Transfer database call failed"; GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.ROLLBACK); } } } else { errorMessage = "No data passed for transferring"; } return(false); }
public static bool TransferItemsOutOfStore(List <TransferItemVO> mdseToTransfer, out int transferNumber, string carrier, out string errorMessage, bool isClxToClx, string toShopName) { errorMessage = ""; transferNumber = 0; string errorCode = ""; icn = new List <string>(); icnQty = new List <string>(); gunNumber = new List <string>(); gunType = new List <string>(); if (mdseToTransfer.Count > 0) { foreach (TransferItemVO transfermdse in mdseToTransfer) { storeNumber = transfermdse.StoreNumber; icn.Add(transfermdse.ICN); icnQty.Add(transfermdse.ICNQty); custNumber = transfermdse.CustomerNumber; tranDate = transfermdse.TransactionDate; mrDate = transfermdse.MdseRecordDate; mrTime = transfermdse.MdseRecordTime; mrUser = transfermdse.MdseRecordUser; mrDesc = transfermdse.MdseRecordDesc; mrChange = transfermdse.MdseRecordChange; mrType = transfermdse.MdseRecordType; classcode = transfermdse.ClassCode; acctNum = transfermdse.AcctNumber; createdBy = transfermdse.CreatedBy; gunNumber.Add(transfermdse.GunNumber); gunType.Add(transfermdse.GunType); } if (icn.Count > 0) { //Make the db call for transfer GlobalDataAccessor.Instance.beginTransactionBlock(); /* storeNumber will be value from last item being transferred (set in foreach loop above), * but all items should be coming FROM the same store. */ if (TransfersDBProcedures.ExecuteTransferOutOfStore(storeNumber, icn, icnQty, custNumber, tranDate, mrDate, mrTime, mrUser, mrDesc, mrChange, mrType, classcode, acctNum, createdBy, gunNumber, gunType, 0, 0, 0, toShopName, isClxToClx, out transferNumber, carrier, out errorCode, out errorMessage)) { GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.COMMIT); return(true); //Web Service invocation will be done during shop close //Make the web service call /*TransferWebService transferwebService = new TransferWebService(); * storeNumber will be value from last item being transferred (set in foreach loop above), * but all items should be coming FROM the same store. * if (!isClxToClx) * { * if (transferwebService.CompleteShopAndGunTransferWS(storeNumber, transferNumber, Utilities.GetIntegerValue(toShopName))) * { * return true; * } * } * else * { * FileLogger.Instance.logMessage(LogLevel.DEBUG, transferwebService, "Web Service call Aborted since transfer is Clx to Clx"); * return true; * } * FileLogger.Instance.logMessage(LogLevel.ERROR, transferwebService, transferwebService.ErrorMessage); * errorMessage = "Transfer web service call failed"; * return false;*/ } else { FileLogger.Instance.logMessage(LogLevel.ERROR, null, errorMessage); errorMessage = "Transfer database call failed"; GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.ROLLBACK); } } } else { errorMessage = "No data passed for transferring"; } return(false); }
public static bool TransferScrap( List <TransferItemVO> mdseToTransfer, int scrapTransferFacilityNumber, int excessTransferFacilityNumber, int refurbTransferFacilityNumber, string carrier, out int transferNumber, out string errorMessage) { errorMessage = String.Empty; transferNumber = 0; string errorCode = String.Empty; icn = new List <string>(); icnQty = new List <string>(); gunNumber = new List <string>(); gunType = new List <string>(); if (mdseToTransfer.Count > 0) { foreach (TransferItemVO transfermdse in mdseToTransfer) { storeNumber = transfermdse.StoreNumber; icn.Add(transfermdse.ICN); icnQty.Add(transfermdse.ICNQty); custNumber = transfermdse.CustomerNumber; tranDate = transfermdse.TransactionDate; mrDate = transfermdse.MdseRecordDate; mrTime = transfermdse.MdseRecordTime; mrUser = transfermdse.MdseRecordUser; mrDesc = transfermdse.MdseRecordDesc; mrChange = transfermdse.MdseRecordChange; mrType = transfermdse.MdseRecordType; classcode = transfermdse.ClassCode; acctNum = transfermdse.AcctNumber; createdBy = transfermdse.CreatedBy; gunNumber.Add(transfermdse.GunNumber); gunType.Add(transfermdse.GunType); } if (icn.Count > 0) { //Make the db call for transfer /* storeNumber will be value from last item being transferred (set in foreach loop above), * but all items should be coming FROM the same store. */ if (!(TransfersDBProcedures.ExecuteTransferOutOfStore(storeNumber, icn, icnQty, custNumber, tranDate, mrDate, mrTime, mrUser, mrDesc, mrChange, mrType, classcode, acctNum, createdBy, gunNumber, gunType, scrapTransferFacilityNumber, excessTransferFacilityNumber, refurbTransferFacilityNumber, null, true, out transferNumber, carrier, out errorCode, out errorMessage))) { FileLogger.Instance.logMessage(LogLevel.ERROR, null, "(Error " + errorCode + ") " + errorMessage); errorMessage = "Transfer database call failed with error code " + errorCode; } else { return(true); } } } else { errorMessage = "No data passed for transferring"; } return(false); }