void CreateVarianceReport() { try { IReports objReports = ReportsBusinessObject.CreateInstance(); LogManager.WriteLog("Fetching report data from database...", LogManager.enumLogLevel.Info); DataSet ExceptionDetails = objReports.GetExceptionSummary(_BatchID); if (ExceptionDetails.Tables[0].Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowVarianceReport(_BatchID); cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } LogManager.WriteLog("ShowExceptionSummaryReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("Report" + ex.Message, LogManager.enumLogLevel.Info); } }
private void CreateBatchWinLossReport() { try { //IReports objReports = ReportsBusinessObject.CreateInstance(); LogManager.WriteLog("Fetching report data from database...", LogManager.enumLogLevel.Info); using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowExceptionSummaryReport(_BatchID); cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } LogManager.WriteLog("ShowExceptionSummaryReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("Report" + ex.Message, LogManager.enumLogLevel.Info); } }
private void GetAFTAuditReport(DateTime dtFromDate, DateTime dtToDate) { try { LogManager.WriteLog("Inside GetAFTAuditReport method", LogManager.enumLogLevel.Info); IReports objReports = ReportsBusinessObject.CreateInstance(); DataSet dtDataset = objReports.GetAFTAuditTrailReport(dtFromDate, dtToDate); if (dtDataset.Tables[0].Rows.Count == 0) { MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { cReportViewer.ShowAFTAuditTrailReport("AFTAuditTrail", dtDataset, dtFromDate, dtToDate); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.Show(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void CreateSGVILiquidationReport() { try { IReports objReports = isCommonCDOforDeclaration ? ReportsBusinessObject.CreateInstance(ExchangeConst, TicketConst) : ReportsBusinessObject.CreateInstance(); DataSet LiquidationDetails = objReports.GetLiquidationDetails(_BatchID); DataSet LiquidationSummaryDetails = objReports.GetLiquidationSummaryDetails(_BatchID); if (LiquidationDetails.Tables[0].Rows.Count == 0 || LiquidationSummaryDetails.Tables[0].Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = (isCommonCDOforDeclaration && !string.IsNullOrEmpty(ExchangeConst)) ? new CReportViewer(CommonUtilities.SiteConnectionString(ExchangeConst), CommonUtilities.TicketingConnectionString(TicketConst)) : new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowLiquidationReport(LiquidationDetails, LiquidationSummaryDetails, _BatchID); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.ShowDialog(); } LogManager.WriteLog("ShowLiquidationReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void btnPrint_Click(object sender, RoutedEventArgs e) { try { if (lstReadReport.Items.Count <= 0) { MessageBox.ShowBox("MessageID526", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { ReadLiquidationReportRecords lstReadLiqRecords = lstReadReport.SelectedItem as ReadLiquidationReportRecords; if (lstReadLiqRecords == null) { MessageBox.ShowBox("MessageID527", BMC_Icon.Information); return; } cReportViewer.ShowLiquidationReportForRead(null, lstReadLiqRecords.ReadId); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.Show(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void CreatePartCollectionReport(int Noofrecords) { try { IReports objReports = null; DataSet dsPartCollDetails = null; if (isCommonCDO) { if (!CollectionHelper.IsServerConnected((cboSiteCode.SelectedItem as SiteConfig).ExchangeConnectionString)) { return; } if (!_collectionHelper.IsAuthorized(SecurityHelper.CurrentUser.SecurityUserID, "BMC.Presentation.CommonCDOforDeclaration")) { return; } objReports = ReportsBusinessObject.CreateInstance((cboSiteCode.SelectedItem as SiteConfig).ExchangeConnectionString, (cboSiteCode.SelectedItem as SiteConfig).TicketConnectionString); } else { objReports = ReportsBusinessObject.CreateInstance(); } dsPartCollDetails = objReports.GetPartCollectionDetails(Noofrecords); if (dsPartCollDetails.Tables[0].Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } if (isCommonCDO) { using (CReportViewer cReportViewer = new CReportViewer((cboSiteCode.SelectedItem as SiteConfig).ExchangeConnectionString, (cboSiteCode.SelectedItem as SiteConfig).TicketConnectionString)) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowPartCollection(Noofrecords, (cboSiteCode.SelectedItem as SiteConfig).ExchangeConnectionString, (cboSiteCode.SelectedItem as SiteConfig).TicketConnectionString); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.Show(); } } else { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowPartCollection(Noofrecords); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.Show(); } } LogManager.WriteLog("Show Part Collection Report Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void ShowBatchWinLossReport() { try { LogManager.WriteLog("ShowBatchWinLossReport Start", LogManager.enumLogLevel.Info); if (IsCommonCDO) { using (CReportViewer cReportViewer = new CReportViewer(_ExchangeConnectionString, _TicketingConnectionString)) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (_BatchID > 0) { if (Settings.Region.ToUpper() == "UK") { cReportViewer.ShowBatchWinLossReportForUK(_BatchID, 0); } else { cReportViewer.ShowBatchWinLossReport(_BatchID, 0); } } cReportViewer.Show(); } } else { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (_BatchID > 0) { if (Settings.Region.ToUpper() == "UK") { cReportViewer.ShowBatchWinLossReportForUK(_BatchID, 0); } else { cReportViewer.ShowBatchWinLossReport(_BatchID, 0); } } cReportViewer.Show(); } } LogManager.WriteLog("ShowBatchWinLossReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void CreateCollectionReport() { try { //IReports objReports = isCommonCDOforDeclaration ? ReportsBusinessObject.CreateInstance(ExchangeConst, TicketConst) : ReportsBusinessObject.CreateInstance(); IReports objReports = ReportsBusinessObject.CreateInstance(); DataSet BatchWinLossDetails = null; if (_BatchID > 0) { BatchWinLossDetails = objReports.GetBatchWinLoss(_BatchID, 0); } else if (_WeekNumber > 0) { BatchWinLossDetails = objReports.GetBatchWinLoss(_WeekNumber, 1); } //DataSet BatchWinLossDetails = objReports.GetBatchWinLoss(_BatchID, _WeekNumber); if (BatchWinLossDetails.Tables[0].Rows.Count == 0 || BatchWinLossDetails.Tables[0].Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = isCommonCDOforDeclaration ? new CReportViewer(ExchangeConst, TicketConst) : new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (_BatchID > 0) { cReportViewer.ShowCollectionReport(_BatchID, 0); } else if (_WeekNumber > 0) { cReportViewer.ShowCollectionReport(_WeekNumber, 1); } cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.ShowDialog(); } LogManager.WriteLog("CreateCollectionReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void CreateWeeklyExceptionSummaryReport(int WeekID) { try { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowWeeklyExceptionSummary(WeekID); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.ShowDialog(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void btnPrint_Click(object sender, RoutedEventArgs e) { try { DataTable dtHistory = null; if (cmb_SelectTop.SelectedValue.ToString() == "All") { dtHistory = objVaultBiz.GetFillHistory(0, 0, ((rsp_Vault_GetTransactionTypesResult)cmbTransType.SelectedItem).TYPE_ID); } else { dtHistory = objVaultBiz.GetFillHistory(0, int.Parse(cmb_SelectTop.SelectedValue.ToString()), ((rsp_Vault_GetTransactionTypesResult)cmbTransType.SelectedItem).TYPE_ID); } if (dtHistory.Rows.Count == 0 || dtHistory.Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (cmb_SelectTop.SelectedValue.ToString() == "All") { cReportViewer.ShowVaultFillHistory(dtHistory, 0, 0); } else { cReportViewer.ShowVaultFillHistory(dtHistory, 0, int.Parse(cmb_SelectTop.SelectedValue.ToString())); } cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.Show(); } LogManager.WriteLog("ShowLiquidationReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
public void CreateVaultCurrentBalanceSlipReport(int Vault_Id, string VaultName, string Serial_No, string Manufacturer_Name, string Type_Prefix, string LoginUser, DateTime CreatedDate, bool IsWebServiceEnabled, decimal FillAmount, decimal TotalAmountOnFill, decimal CurrentBalance) { try { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowVaultCurrentBalanceSlip(Vault_Id, VaultName, Serial_No, Manufacturer_Name, Type_Prefix, LoginUser, CreatedDate, IsWebServiceEnabled, Convert.ToDecimal(FillAmount), Convert.ToDecimal(TotalAmountOnFill), Convert.ToDecimal(CurrentBalance)); cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } LogManager.WriteLog("Show Vault Current Balance Slip Report Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
void PrintDrop(DataRow drBalance) { try { if (drBalance != null) { using (CReportViewer cReportViewer = new CReportViewer()) { cReportViewer.ShowVaultCurrentDropSlip(int.Parse(cmb_DeviceName.SelectedValue.ToString()), drBalance["Name"].ToString(), drBalance["Serial_NO"].ToString(), drBalance["Manufacturer_Name"].ToString(), drBalance["Type_Prefix"].ToString(), SecurityHelper.CurrentUser.DisplayName, Convert.ToDateTime(drBalance["CreatedDate"]), Convert.ToBoolean(drBalance["IsWebServiceEnabled"]), Convert.ToDecimal(drBalance["FillAmount"]), Convert.ToDecimal(drBalance["TotalAmountOnFill"]), Convert.ToDecimal(drBalance["CurrentBalance"]), _IsFinalDrop); cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } } } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
private void btnPrint_Click(object sender, RoutedEventArgs e) { try { bool TicketShow = true; if (!Security.SecurityHelper.HasAccess("BMC.Presentation.CashDeskManager.UserControls.CashDeskManagerAllDetails.lvViewAll.TicketValue")) { TicketShow = false; } btnPrint.IsEnabled = false; //DataSet _DtDetails = BMC.Common.Utilities.CollectionExtensions.ToDataSet<CashierTransactionsDetails>(lstCashierTransactionsDetails, "DetailsView"); BMC.Business.CashDeskOperator.Reports objReports = new BMC.Business.CashDeskOperator.Reports(); //DataSet _DtDetails = objReports.GetCashierTransactionsDetails(true, true, true, true, // true, true, true, true, // true, true, // true, true, true, true, // true, true, // true, true, // StartDate, EndDate, user, iRoute_No); if (dtTickets.Tables[0].Rows.Count == 0) { MessageBox.ShowBox("MessageID47"); return; } using (CReportViewer objReportViewer = new CReportViewer()) { objReportViewer.showDetailedReport(dtTickets, StartDate, EndDate, sFooterText, TicketShow); objReportViewer.SetOwner(this); objReportViewer.ShowDialog(); } } finally { btnPrint.IsEnabled = true; } }
private void CreateLiquidationReport() { try { if (Settings.SGVI_Enabled) { CreateSGVILiquidationReport(); return; } IReports objReports = isCommonCDOforDeclaration ? ReportsBusinessObject.CreateInstance(ExchangeConst, TicketConst) : ReportsBusinessObject.CreateInstance(); LogManager.WriteLog("Check whether the Liquidation performed for the batch or not-Starts", LogManager.enumLogLevel.Info); int?iLiquidationPerformed = 0; int isLiquidationPerformedForBatch = objReports.CheckLiquidationPerformed(_BatchID, ref iLiquidationPerformed); if (isLiquidationPerformedForBatch == 0) { MessageBox.ShowBox("MessageID891", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Launch the liquidation report", LogManager.enumLogLevel.Info); cReportViewer.ShowLiquidationReportForRead(_BatchID, null); cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.ShowDialog(); } LogManager.WriteLog("ShowLiquidationReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
/// <summary> /// Displays the Exception Summary Report for selected collection batch in a new dialog /// </summary> private void CreateExceptionSummaryReport() { try { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (!string.IsNullOrEmpty(ExchangeConst) && !string.IsNullOrEmpty(TicketConst)) { cReportViewer.ShowExceptionSummaryReport(_BatchID, ExchangeConst, TicketConst); } else { cReportViewer.ShowExceptionSummaryReport(_BatchID); } cReportViewer.SetOwner(Window.GetWindow(this)); cReportViewer.ShowDialog(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void PrintSpotCheckReport() { Installations objInstallationDetails = tvMachineList.SelectedItem as Installations; if (objInstallationDetails == null) { return; } List <SpotCheck> lstSpotCheck = new List <SpotCheck>(); lstSpotCheck = lstSpotCheckSummaryDetails.Where(item => item.InstallationNo == objInstallationDetails.Installation_No).ToList(); if (lstSpotCheck == null || lstSpotCheck.Count <= 0) { return; } using (CReportViewer cReportViewer = new CReportViewer()) { cReportViewer.ShowSpotCheckReport( objInstallationDetails.Bar_Position_Name, objInstallationDetails.Zone_Name.IsNullOrEmpty() ? string.Empty : objInstallationDetails.Zone_Name, objInstallationDetails.GameTitle, //(Convert.ToDecimal(objInstallationDetails.POP) / 100).ToString(), (Convert.ToDecimal(objInstallationDetails.POP)).ToString(), lstSpotCheck[0].DateTimeStamp, (lstSpotCheck[0].CashIn - lstSpotCheck[0].CashOut), lstSpotCheck[0].CashIn, Convert.ToDecimal(lstSpotCheck[0].Payout), Convert.ToDecimal(lstSpotCheck[0].CoinsDrop.ToString("#,##0.00")), lstSpotCheck[0].HandPay, lstSpotCheck[0].Date, Settings.SiteCode ); cReportViewer.ShowDialog(); } }
private void button_Click(object sender, RoutedEventArgs e) { try { int InstallationNumber = 0; int ValidationLength = 0; string _Barcode = this.ucValueCalc.txtDisplay.Text.Trim(); System.Windows.Forms.DialogResult _diagResult; btnVerify.IsEnabled = false; if (isScannerFired) //check done not to fire the verify event twice while verifying a ticket using scanner { isScannerFired = false; return; } if ((sender is System.Windows.Controls.TextBox)) { isScannerFired = true; } else { isScannerFired = false; } if (this.ucValueCalc.txtDisplay.Text.Trim().Length > 0) { //8-digit ticket validation. //Slot ticket cannot be redeemed via cashdesk. if (this.ucValueCalc.txtDisplay.Text.Trim().Length != 18) { LinqDataAccessDataContext linqDBExchange = new LinqDataAccessDataContext(CommonDataAccess.ExchangeConnectionString); IEnumerable <InstallationFromTicket> InstallationTicket = linqDBExchange.GetInstallationNumber(_Barcode); if (InstallationTicket != null) { foreach (var item in InstallationTicket) { InstallationNumber = item.installation_no.Value; _Barcode = item.strbarcode; } DataTable InstallationDetails = (new CommonDataAccess()).GetInstallationDetails(0, InstallationNumber, false, false); if (InstallationDetails.Rows.Count > 0) { int.TryParse(InstallationDetails.Rows[0]["Validation_length"].ToString(), out ValidationLength); if (ValidationLength != _Barcode.Length) { MessageBox.ShowBox("MessageID403", BMC_Icon.Error); return; } } } } TicketsHelper objTicketsHelper = new TicketsHelper(); int? nResult = -1; decimal dAmount = 0; int iTransactionNo = 0; int iSequenceNo = 0; //foreach (var obj in objTicketsHelper.ValidateVoidVoucher(this.ucValueCalc.txtDisplay.Text.Trim(), ref nResult)) //{ // dAmount = Convert.ToDecimal(obj.iAmount)/100; //} dAmount = objTicketsHelper.ValidateVoidVoucher(_Barcode, Security.SecurityHelper.CurrentUser.User_No, ref nResult); switch (nResult) { case 0: { if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { //Message: Are you sure you want to Void the Voucher? _diagResult = MessageBox.ShowBox("MessageID512", BMC_Icon.Question, BMC_Button.YesNo, this.ucValueCalc.txtDisplay.Text.Trim(), Convert.ToString(dAmount)); if (_diagResult == System.Windows.Forms.DialogResult.No) { return; } } else { _diagResult = System.Windows.Forms.DialogResult.Yes; } if (_diagResult == System.Windows.Forms.DialogResult.Yes) { string barcode = this.ucValueCalc.txtDisplay.Text.Trim(); foreach (var obj in objTicketsHelper.UpdateVoidVoucher(barcode, System.Environment.MachineName, Security.SecurityHelper.CurrentUser.User_No, txtNotes.Text)) { iTransactionNo = (int)obj.iTransactionNo; iSequenceNo = obj.TE_ID; } // TIS Printed Tickets if (VoucherHelper.IsTISPrintedTicket(barcode)) { VoucherHelper.SendTISVoidTicket(barcode, Security.SecurityHelper.CurrentUser.User_No); } //Message: "Voucher Voided Successfully." MessageBox.ShowBox("MessageID513", BMC_Icon.Information); //Receipt BMC.Business.CashDeskOperator.Reports objReports = new BMC.Business.CashDeskOperator.Reports(); string sCode = BMC.Transport.Settings.SiteCode; using (CReportViewer objReportViewer = new CReportViewer()) { objReportViewer.PrintVoidVoucherReceipt(System.Environment.MachineName, this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, iTransactionNo, sCode, iSequenceNo); //objReportViewer.ShowDialog(); } Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Voucher Voided Successfully"); lblVoidAmountValue.Visibility = Visibility.Visible; lblVoidAmount.Visibility = Visibility.Visible; lblVoidAmountValue.Text = string.Empty; lblVoidAmountValue.Text = dAmount.ToString("0.00"); } break; } case 1: { //Voucher Not Found //Message: "Voucher is not available in System" MessageBox.ShowBox("MessageID514", BMC_Icon.Error); Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Voucher Not Found"); lblVoidAmount.Visibility = Visibility.Hidden; lblVoidAmountValue.Visibility = Visibility.Hidden; //Audit break; } case 2: { // Invalid for Slots, only CashDesk is allowed. //Message: "Void is applicable only for Cash Desk Vouchers" MessageBox.ShowBox("MessageID515", BMC_Icon.Error); Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Void is applicable only for Cash Desk Vouchers"); //Audit lblVoidAmount.Visibility = Visibility.Hidden; lblVoidAmountValue.Visibility = Visibility.Hidden; break; } case 3: { //PAID Status // Message: "Voucher has already been redeemed." MessageBox.ShowBox("MessageID516", BMC_Icon.Error); Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Voucher has already been redeemed"); lblVoidAmount.Visibility = Visibility.Hidden; lblVoidAmountValue.Visibility = Visibility.Hidden; //Audit break; } case 4: { //Already Voided // Message: "Voucher has already been Voided." MessageBox.ShowBox("MessageID517", BMC_Icon.Error); Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Voucher has already been Voided"); lblVoidAmount.Visibility = Visibility.Hidden; lblVoidAmountValue.Visibility = Visibility.Hidden; //Audit break; } case 5: { //Expired Date // Message: "Voucher has expired." MessageBox.ShowBox("MessageID518", BMC_Icon.Error); Audit(this.ucValueCalc.txtDisplay.Text.Trim(), dAmount, "Voucher has expired"); lblVoidAmount.Visibility = Visibility.Hidden; lblVoidAmountValue.Visibility = Visibility.Hidden; //Audit break; } } } else { //Message: "Please enter or scan a valid Voucher Number MessageBox.ShowBox("MessageID519", BMC_Icon.Warning); this.ucValueCalc.txtDisplay.Focus(); } ClearAll(); } catch (Exception ex) { MessageBox.ShowBox("MessageID520", BMC_Icon.Error); BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex); ClearAll(); } finally { btnVerify.IsEnabled = true; } }
private void btnConfirm_Click(object sender, RoutedEventArgs e) { try { if (objCommonLiquidation.ProfitShareGroupId <= 0) { MessageBox.ShowBox("MessageID490", BMC_Icon.Information); return; } if (string.IsNullOrEmpty(txtAdvanceToRetailer.Text)) { MessageBox.ShowBox("MessageID370", BMC_Icon.Information); return; } decimal dAdvanceToRetailer = 0.0M; if (!CheckForValidAdvanceToRetailValue(out dAdvanceToRetailer)) { MessageBox.ShowBox("MessageID434", BMC_Icon.Information); return; } System.Windows.Forms.DialogResult dr = MessageBox.ShowBox("MessageID371", BMC_Icon.Question, BMC_Button.YesNo); if (dr.ToString() == "Yes") { //Calculate the retailer negative net CalculateRetailerNegative(); if (oReadLiquidationConfiguration.SaveLiquidation(objCommonLiquidation) == 0) { MessageBox.ShowBox("MessageID488", BMC_Icon.Information); Audit(true, objCommonLiquidation.Read_No); System.Windows.Forms.DialogResult res = MessageBox.ShowBox("MessageID251", BMC_Icon.Question, BMC_Button.YesNo); if (res == System.Windows.Forms.DialogResult.Yes) { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); cReportViewer.ShowLiquidationReportForRead(null, objCommonLiquidation.Read_No); cReportViewer.SetOwner(this); cReportViewer.Show(); } } } else { MessageBox.ShowBox("MessageID489", BMC_Icon.Information); return; } this.Close(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
// private void CreateExceptionSummaryReport() { try { //IReports objReports = ReportsBusinessObject.CreateInstance(); LogManager.WriteLog("Fetching report data from database...", LogManager.enumLogLevel.Info); DataSet ExceptionDetails = objReports.GetExceptionSummary(_BatchID); if (ExceptionDetails.Tables[0].Rows.Count == 0) { LogManager.WriteLog("No Records found for the selected criteria - Return", LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } if (IsCommonCDO) { using (CReportViewer cReportViewer = new CReportViewer(_ExchangeConnectionString, _TicketingConnectionString)) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (Settings.Region.ToUpper() == "UK") { cReportViewer.ShowExceptionSummaryReportUK(_BatchID, _ExchangeConnectionString, _TicketingConnectionString); } else { cReportViewer.ShowExceptionSummaryReport(_BatchID, _ExchangeConnectionString, _TicketingConnectionString); } cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } } else { using (CReportViewer cReportViewer = new CReportViewer()) { LogManager.WriteLog("Report data fetched successfully from database", LogManager.enumLogLevel.Info); if (Settings.Region.ToUpper() == "UK") { cReportViewer.ShowExceptionSummaryReportUK(_BatchID); } else { cReportViewer.ShowExceptionSummaryReport(_BatchID); } cReportViewer.SetOwner(System.Windows.Window.GetWindow(this)); cReportViewer.Show(); } } LogManager.WriteLog("ShowExceptionSummaryReport Successfull", LogManager.enumLogLevel.Info); } catch (Exception ex) { LogManager.WriteLog("Report" + ex.Message, LogManager.enumLogLevel.Info); } }
// /// <summary> /// Performs the auto cash dispense. /// </summary> /// <returns>True if succeeded; otherwise false.</returns> public bool AutoCashDispense(string fieldName, string fieldValue, decimal value) { DispenserWorkerResult result = DispenserWorkerResult.None; string message = string.Empty; this.EnsureDecksAreLoaded(); IDictionary <string, DeckDenomValue> pairs = new SortedDictionary <string, DeckDenomValue>(StringComparer.InvariantCultureIgnoreCase); string keyLower = "LOWER"; string keyUpper = "UPPER"; decimal upperCount = 0; decimal lowerCount = 0; decimal receiptAmount = 0; try { // Determine the number of counts from lower and upper deck decimal upperAvailAmount = this.UpperDeck.RemainingValueCalculated; decimal lowerAvailAmount = this.LowerDeck.RemainingValueCalculated; // denominations decimal upperDenom = this.UpperDeck.Denimination; decimal lowerDenom = this.LowerDeck.Denimination; if (lowerDenom > upperDenom) { // denom decimal tempDenom = lowerDenom; lowerDenom = upperDenom; upperDenom = tempDenom; // total amount decimal tempAmount = lowerAvailAmount; lowerAvailAmount = upperAvailAmount; upperAvailAmount = tempAmount; keyLower = "UPPER"; keyUpper = "LOWER"; } // mapping for upper and lower deck pairs.Add(keyLower, new DeckDenomValue() { Denomination = lowerDenom, Value = lowerAvailAmount }); pairs.Add(keyUpper, new DeckDenomValue() { Denomination = upperDenom, Value = upperAvailAmount }); // if valid amount is passed if (value > 0) { decimal inputValue = value; // upper count upperCount = Math.Floor(inputValue / pairs[keyUpper].Denomination); if (upperCount > pairs[keyUpper].TotalCount) { upperCount = pairs[keyUpper].TotalCount; } inputValue -= (upperCount * pairs[keyUpper].Denomination); // lower count lowerCount = Math.Floor(inputValue / pairs[keyLower].Denomination); if (lowerCount > pairs[keyLower].TotalCount) { lowerCount = pairs[keyLower].TotalCount; } inputValue -= (lowerCount * pairs[keyLower].Denomination); // updated values pairs[keyUpper].Value = upperCount; pairs[keyLower].Value = lowerCount; receiptAmount = inputValue; } // dispense result = this.Dispense(pairs["UPPER"].Value, pairs["LOWER"].Value, out message); if (result != (DispenserWorkerResult.Success | DispenserWorkerResult.LowerDeckOK | DispenserWorkerResult.UpperDeckOK)) { LogManager.WriteLog(message, LogManager.enumLogLevel.Error); } else { LogManager.WriteLog(message, LogManager.enumLogLevel.Info); } // try to print the remaing amount as receipt if (receiptAmount > 0) { try { using (CReportViewer objReportViewer = new CReportViewer()) { objReportViewer.PrintCashDispenserReceipt(System.Environment.MachineName, fieldName, fieldValue, Convert.ToDecimal(receiptAmount)); } } catch (Exception ex) { ExceptionManager.Publish(ex); } } WriteAuditLog(this.UpperDeck, this.LowerDeck, upperCount, lowerCount, "Receipt", receiptAmount); } catch (Exception ex) { ExceptionManager.Publish(ex); } return(result == (DispenserWorkerResult.Success | DispenserWorkerResult.LowerDeckOK | DispenserWorkerResult.UpperDeckOK)); }