public SummaryReport(List <TransferItemVO> transferList, ReportObject.TransferINReportStruct reportObj, IPdfLauncher pdfLauncher) : base(pdfLauncher) { _transferList = transferList; _reportObj = reportObj; _logPath = reportObj.logPath; }
private void selectTransferInItemsFormAction(object sender, object data) { NavBox selectTransferInItemsNavBox = (NavBox)sender; NavBox.NavAction action = selectTransferInItemsNavBox.Action; if (action == NavBox.NavAction.BACKANDSUBMIT) { GlobalDataAccessor.Instance.DesktopSession.HistorySession.Back(); action = NavBox.NavAction.SUBMIT; } var dSession = GlobalDataAccessor.Instance.DesktopSession; switch (action) { case NavBox.NavAction.SUBMIT: //Default happy path next state string errorCode, errorText; int ticketNumber; GlobalDataAccessor.Instance.beginTransactionBlock(); bool retValue = TransferProcedures.ProcessTransferIn( dSession, dSession.ActiveTransferIn, out ticketNumber, out errorCode, out errorText); if (!retValue || ticketNumber == 0) { GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.ROLLBACK); MessageBox.Show("An error occured while completing the transfer. Please contact Shop Systems Support."); } else { GlobalDataAccessor.Instance.endTransactionBlock(EndTransactionType.COMMIT); //----------- //MessageBox.Show("report"); var transferList = new List <TransferItemVO>(); var reportObj = new ReportObject.TransferINReportStruct(); reportObj.transDate = ShopDateTime.Instance.ShopDate.ToString(); reportObj.userID = dSession.FullUserName; reportObj.ToStoreName = GlobalDataAccessor.Instance.CurrentSiteId.StoreNickName; reportObj.ToStoreNo = string.Empty; reportObj.FromShopName = string.Format("Shop # - {0}", dSession.ActiveTransferIn.StoreInfo.StoreNickName); reportObj.FromShopNo = string.Empty; reportObj.FromStoreAddrLine1 = string.Empty; reportObj.FromStoreAddrLine2 = string.Empty; reportObj.storeMgrPhone = string.Empty; reportObj.storeMgrName = string.Empty; reportObj.transNum = string.Format("{0}", ticketNumber); reportObj.Carrier = dSession.ActiveTransferIn.Carrier; reportObj.DateReceived = dSession.ActiveTransferIn.StatusDate.ToString(); reportObj.TransferReference = dSession.ActiveTransferIn.TransferTicketNumber.ToString(); reportObj.ReceivedBy = string.Empty; reportObj.logPath = SecurityAccessor.Instance.EncryptConfig.ClientConfig.GlobalConfiguration.BaseLogPath; var transreport = new Reports.TransferIN.SummaryReport(GlobalDataAccessor.Instance.DesktopSession.ActiveTransferIn.Items, reportObj, PdfLauncher.Instance); transreport.CreateReport(); //TODO: Store report in couch db if (SecurityAccessor.Instance.EncryptConfig.ClientConfig.ClientConfiguration.PrintEnabled && dSession.LaserPrinter.IsValid) { string laserPrinterIp = dSession.LaserPrinter.IPAddress; int laserPrinterPort = dSession.LaserPrinter.Port; PrintingUtilities.printDocument(transreport.getReportFileName(), laserPrinterIp, laserPrinterPort, 1); } //end if (PrintEnabled) //------------ } this.nextState = TransferInFlowState.ManageTransfer; break; case NavBox.NavAction.CANCEL: this.nextState = TransferInFlowState.CancelFlow; break; default: throw new ApplicationException("" + action + " is not a valid state for SelectTransferInItems"); } this.executeNextState(); }