private void btnBlockPort_Click(object sender, RoutedEventArgs e) { try { var port1 = (bool)chkPort1.IsChecked; var port2 = (bool)chkPort2.IsChecked; var port3 = (bool)chkPort3.IsChecked; if (port1 || port2 || port3) { CMachineMaintenance objMachineMaintenance = new CMachineMaintenance(); var AuxPort = Convert.ToByte(port1); var SlotLinePort = Convert.ToByte(port2); var GATPort = Convert.ToByte(port3); //objMachineMaintenance.BlockPort(installationNo, AuxPort, SlotLinePort, GATPort); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.MachineMaintenance, Audit_Screen_Name = "Machine Maintenance View", Audit_Desc = "Port Blocking - Installation No: " + installationNo.ToString(), AuditOperationType = OperationType.MODIFY, }); MessageBox.ShowBox("MessageID323", BMC_Icon.Information, BMC_Button.OK); Close(); } else { MessageBox.ShowBox("MessageID324", BMC_Icon.Information, BMC_Button.OK); } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void button1_Click(object sender, EventArgs e) { Audit_History objAH = new Audit_History(); objAH.Audit_User_ID = 101; objAH.Audit_User_Name = "user1"; //objAH.AuditModuleID =ModuleID.Enrollment; //not required objAH.AuditModuleName = ModuleName.Enrollment; objAH.EnterpriseModuleName = ModuleNameEnterprise.Settings; objAH.Audit_Screen_Name = "Screen Name"; objAH.Audit_Slot = "LC0003"; objAH.Audit_Field = "FieldName"; //can be enumerated objAH.Audit_Old_Vl = "old"; objAH.Audit_New_Vl = "new"; objAH.Audit_Desc = "Desc"; objAH.AuditOperationType = OperationType.ADD; AuditViewerBusiness.InsertAuditData(objAH); //business.InsertAuditData(userID, sUserName, nmoduleId, sModuleName, sSlot, sAudField, sOldValue, sNewValue, sAudDesc); //dataGridView1.DataSource = AVB.GetAuditDetails(System.DateTime.Now.AddDays(-3), System.DateTime.Now.AddDays(3), ((int)ModuleID.Enrollment).ToString()); }
private void btnBlockPorts_Click(object sender, RoutedEventArgs e) { try { ManageSlotPorts(); UpdateSlotPortStatus(); try { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.PortBlocking, Audit_Screen_Name = "Enrollment|Enable/Disable Ports", Audit_Desc = "Slot Ports Enabled/Disabled", AuditOperationType = OperationType.MODIFY, Audit_Field = "IsAuxSerialPortEnabled|IsGatSerialPortEnabled|IsSlotLinePortEnabled", Audit_New_Vl = string.Format("{0}|{1}|{2}", Convert.ToInt32(rbAuxSerialPortEnabled.IsChecked).ToString(), Convert.ToInt32(rbGatSerialPortEnabled.IsChecked).ToString(), Convert.ToInt32(rbSlotLinePortDisabled.IsChecked).ToString()), Audit_Slot = installationNo.ToString() }); } catch (Exception ex) { ExceptionManager.Publish(ex); } MessageBox.ShowBox("MessageID349", BMC_Icon.Information); } catch (Exception ex) { ExceptionManager.Publish(ex); MessageBox.ShowBox("MessageID350", BMC_Icon.Error); } }
private void IsEnabled(bool _IsEnabled) { try { if (_ListActiveMachines != null) { if (_ListActiveMachines.Count(x => x.IsSelected == true) > 0) { _ListActiveMachines.ForEach(x => { if (x.IsSelected == true) { if (_IsEnabled == true) { _EnableMachineBiz.UpdateBarPositionMachine(x.BarPosNumber, true, true, 0); x.Status = "Enabled"; x.Message = "Active"; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.EnableDisableMachine, Audit_Screen_Name = "EnableDisableMachine", Audit_Desc = "BarPosNumber-" + x.BarPosNumber + "-" + x.Status + "", AuditOperationType = OperationType.MODIFY, Audit_Field = "BarPosNumber", Audit_New_Vl = x.BarPosNumber, Audit_Slot = string.Empty }); } else { _EnableMachineBiz.UpdateBarPositionMachine(x.BarPosNumber, true, false, 1); x.Status = "Disabled"; x.Message = "DeActive"; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.EnableDisableMachine, Audit_Screen_Name = "EnableDisableMachine", Audit_Desc = "BarPosNumber-" + x.BarPosNumber + "-" + x.Status + "", AuditOperationType = OperationType.MODIFY, Audit_Field = "BarPosNumber", Audit_New_Vl = x.BarPosNumber, Audit_Slot = string.Empty }); } } }); } else { MessageBox.ShowBox("Please select atleast a single BarPosition", true, ""); } } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { try { System.Windows.Forms.DialogResult dr; dr = MessageBox.ShowBox("MessageID413", BMC_Icon.Question, BMC_Button.YesNo); if (dr.ToString().ToUpper() == "NO") { //continue printing _mreResume.Set(); } else { _mreShutdown.Set(); _isClosed = true; double TotalAmoount = PromCount * PromoTickAmt; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Promotion, Audit_Screen_Name = "Promo Print Cancelled", Audit_Desc = "Promo Name: " + PromoName + "; TicketAmount: " + _PromotionTicketAmount + "; Number of Tickets: " + _PromoTicketCount + "; Total Promotion Amount: " + TotalAmoount + "; Expiry Date: " + ExpiryDate, AuditOperationType = OperationType.ADD, Audit_New_Vl = PromoName }); IsPrintedCompleted = true; } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void btnClear_Click(object sender, RoutedEventArgs e) { try { ClearControls(); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Shortpay, Audit_Screen_Name = "Shortpay", Audit_Desc = "Cleared Data", AuditOperationType = OperationType.ADD, Audit_Field = "Shortpay", Audit_New_Vl = "NULL" }); //objValueCalc.Clear_Click(sender, e); objValueCalc.ClearAll(); lstInstallation.Focus(); if (dtInstallations.Rows.Count > 0) { lstInstallation.SelectedIndex = 0; } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void btnClearMachine_Click(object sender, RoutedEventArgs e) { try { btnClearMachine.IsEnabled = false; LogManager.WriteLog("Inside Method", LogManager.enumLogLevel.Info); if (lstPositionDetailsEvents.Items.Count == 0) { MessageBox.ShowBox("MessageID896", BMC_Icon.Information); return; } if (MessageBox.ShowBox("MessageID231", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.No) { return; } if (ClearEvents("MACHINE", string.Empty, 0)) { MessageBox.ShowBox("MessageID227", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Events, Audit_Screen_Name = "Events|ClearMachine", Audit_Desc = "Clear Machine", AuditOperationType = OperationType.MODIFY, Audit_Field = "Event Number(s)", Audit_Old_Vl = "Open Events", Audit_New_Vl = "Closed" }); } else { MessageBox.ShowBox("MessageID228", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Events, Audit_Screen_Name = "Events|ClearMachine", Audit_Desc = "Unable to Clear Machine", AuditOperationType = OperationType.MODIFY, Audit_Field = "Event Number(s)", Audit_Old_Vl = "Open Events", Audit_New_Vl = "" }); } iPageNum = iLastPage = 1; FillEventsDataForPosition(); } finally { btnClearMachine.IsEnabled = true; } }
private void Audit(string sDesc) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Promotion, Audit_Screen_Name = "Vouchers|PrintVoucher", Audit_Desc = sDesc, AuditOperationType = OperationType.ADD }); }
private void Audit(string sDesc) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.SiteLicensing, Audit_Screen_Name = "LicenseActivation", Audit_Desc = sDesc, AuditOperationType = OperationType.ADD }); }
private void Audit(bool success, int?iReadNo) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ReadBasedLiquidation, Audit_Screen_Name = "ReadBasedLiquidation | ReadBasedLiquidation", Audit_Field = "ReadBasedLiquidation", Audit_Desc = "ReadBasedLiquidation for Read No: " + iReadNo + " ,Read Performed Date: " + sReadDate + " is Completed.", AuditOperationType = OperationType.ADD }); }
private void Audit(string sVoucherNumber, decimal dAmount, string sDescription) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.VoidVoucher, Audit_Screen_Name = "Vouchers|VoidVoucher", Audit_Desc = sDescription, AuditOperationType = OperationType.MODIFY, Audit_Field = "Voucher Number:CashDesk location:Amount:Reason", Audit_New_Vl = sVoucherNumber + ":" + System.Environment.MachineName + ":" + dAmount.ToString("C", CultureInfo.CurrentCulture) + ":" + this.txtNotes.Text }); }
private void Audit(bool success, int iBatchNo) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { //Audit_ID = Convert.ToInt32( ModuleID.LiquidationForProfitShare), AuditModuleName = ModuleName.CollectionBasedLiquidation, Audit_Screen_Name = "CollectionBasedLiquidation | CollectionBasedLiquidation", Audit_Field = "CollectionBasedLiquidation", Audit_Desc = "CollectionBasedLiquidation for Batch No: " + iBatchNo + ",Collection Performed Date: " + _entity.Liquidation_Date + " is Completed.", AuditOperationType = OperationType.ADD }); }
private void Audit(string sDesc, string JOBID) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = sDesc, AuditOperationType = OperationType.ADD, Audit_Slot = Asset, Audit_Field = "JOB ID", Audit_New_Vl = JOBID }); }
private void Audit_Error(string sDesc) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Enrollment, Audit_Screen_Name = "Enrollment|MachineInstallation", Audit_Desc = sDesc, AuditOperationType = OperationType.ADD, Audit_Field = "Position", Audit_New_Vl = objPosDetails.Position, Audit_Slot = objPosDetails.AssetNo }); }
private void Audit(string sRedeemedAmount, string sTicketNumber, string sDesc) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.OfflineVoucher_Shortpay, Audit_Screen_Name = "Offline Voucher-Shortpay", //Audit_Screen_Name = "Vouchers|RedeemVoucher", Audit_Desc = sDesc, AuditOperationType = OperationType.MODIFY, Audit_Field = "Offline Voucher-Shortpay", //Audit_Field = "Voucher Number", Audit_New_Vl = sTicketNumber }); }
private void btn_Unlock_Click(object sender, RoutedEventArgs e) { try { string strRequest = string.Empty; if (olockDetails != null) { if (olockDetails.Count(x => x.IsSelected == true) > 0) { olockDetails.ForEach(x => { if (x.IsSelected == true) { strRequest = strRequest + "," + x.Lock_ID.ToString(); } }); } else { MessageBox.ShowBox("MessageID532", BMC_Icon.Information); } if (strRequest.Length < 1) { return; } LogManager.WriteLog("Unlock: btn_Unlock_Click UNlocking" + strRequest, LogManager.enumLogLevel.Debug); oApplicationLockObject.UpdateAppLockState(strRequest); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Unlock, Audit_Screen_Name = "Unlock", Audit_Desc = "Lock status for Lock_IDs : " + strRequest + " has be modified", AuditOperationType = OperationType.MODIFY, Audit_Field = "Lock_Active", Audit_Old_Vl = "1", Audit_New_Vl = "0" }); RefreshList(); } UnlockDetails(); } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
public void PromoVoidAudit(string VoidPromationNumber, string voidNumberofTickets, string voidAmount, string VoidEXdate, string promationalName, string voiddate) { try { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Promotion, Audit_Screen_Name = "Promo Void", Audit_Desc = " Promotional Name: " + promationalName + ";No.Of Tickets Voided: " + voidNumberofTickets + ";Amount: " + voidAmount + "; VoidDate: " + voiddate + "; Expiry Date: " + VoidEXdate, AuditOperationType = OperationType.ADD, Audit_New_Vl = promationalName }); } catch (Exception ex) { LogManager.WriteLog("Promotional Void : " + ex.Message, LogManager.enumLogLevel.Error); } }
void Enroll_Click(object sender, RoutedEventArgs e) { try { LogManager.WriteLog("CNGAEnroll->Enroll_Click()", LogManager.enumLogLevel.Debug); if (cmbNGAType.SelectedItem != null) { string Name = ((GetNGATypesResult)cmbNGAType.SelectedItem).Name; if (Vault.CreateInstance().EnrollNGA(Current_NGAName.Installation_No, Security.SecurityHelper.CurrentUser.SecurityUserID)) { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.EnrollmentNGA, Audit_Screen_Name = "NGA Enrollment", Audit_Desc = "NGA Enrollment Completed For Type: " + cmbNGAType.Text + "; Name: " + cmbNGAName.Text + "; ID:" + Current_NGAName.NGAID + "; User ID :" + Security.SecurityHelper.CurrentUser.SecurityUserID, AuditOperationType = OperationType.MODIFY, }); LogManager.WriteLog("CNGAEnroll->Enrollment Completed Type: " + cmbNGAType.Text + " Name: " + cmbNGAName.Text + " ID:" + Current_NGAName.NGAID, LogManager.enumLogLevel.Debug); if (Name.ToLower().Equals("vault")) { string strMsg = Application.Current.FindResource("Vault_MessageID12").ToString().Replace("@@@@@", Current_NGAName.NGAName); MessageBox.ShowBox(strMsg, BMC_Icon.Information, true); LoadNGANames(Name); cVaultEnroll.DataContext = null; cVaultEnroll.lst_CassetteDetails.ItemsSource = null; } } else { if (Name.ToLower().Equals("vault")) { string strMsg = Application.Current.FindResource("Vault_MessageID13").ToString().Replace("@@@@@", Current_NGAName.NGAName); MessageBox.ShowBox(strMsg, BMC_Icon.Error, true); } } } } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
private void WriteAuditLog(CashDispenserItem deck, decimal value) { try { string auditValue = deck.CassetteAlias + " : " + deck.Denimination + ", " + value.ToString(); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Cash_Dispenser, Audit_Screen_Name = "Manual Cash Dispense", Audit_Desc = "From Module : " + _parentModuleName.ToString(), AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = auditValue, Audit_Slot = string.Empty }); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void AuditModule(string Description, string AssetNo, string OldGMUNo, string NewGMUNo) { try { AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.UpdateGmuNo, Audit_Screen_Name = "Update GMU No For Asset", Audit_Desc = Description + " GMUNo: " + OldGMUNo + "-->" + NewGMUNo, AuditOperationType = OperationType.MODIFY, Audit_Slot = AssetNo, Audit_Field = "GMUNo", Audit_Old_Vl = OldGMUNo, Audit_New_Vl = NewGMUNo }); } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
/// <summary> /// Logs fault event /// </summary> /// <param name="Sender"></param> /// <param name="args"></param> private void LogCashDeskFaultEvent(object Sender, RoutedEventArgs args) { string strMsg = string.Empty; IFieldService fieldService = FieldServiceBusinessObject.CreateInstance(); strMsg = fieldService.LogSiteEvent(InstallationNo, Int32.Parse(((Button)Sender).Tag.ToString())); if (strMsg.Contains("Open service already exists.")) { MessageBox.ShowBox("MessageID139"); } else if (strMsg == string.Empty) { MessageBox.ShowBox("MessageID140"); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "An error occured while logging a Service call.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } else { MessageBox.ShowBox("MessageID141", ((Button)Sender).Content.ToString()); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Service Call has been logged in for" + ((Button)Sender).Content.ToString(), AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); this.Close(); } }
// private void WriteAuditLog(CashDispenserItem UpperDeck, CashDispenserItem LowerDeck, decimal UpperCount, decimal LowerCount, string AutoDispense, decimal value) { try { string auditValue = UpperDeck.CassetteAlias + " : " + UpperDeck.Denimination + ", " + (UpperCount * UpperDeck.Denimination).ToString(); auditValue += " | " + LowerDeck.CassetteAlias + " : " + LowerDeck.Denimination + ", " + (LowerCount * LowerDeck.Denimination).ToString(); auditValue += " | " + AutoDispense + " : " + value.ToString(); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Cash_Dispenser, Audit_Screen_Name = "Auto Cash Dispense", Audit_Desc = "From Module : " + ModuleName.Cash_Dispenser.ToString(), AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = auditValue, Audit_Slot = string.Empty }); } catch (Exception ex) { ExceptionManager.Publish(ex); } }
public void PrintTickets() { try { App application = App.Current as App; Thread.CurrentThread.CurrentUICulture = application.CurrentUICulture; Thread.CurrentThread.CurrentCulture = application.CurrentCulture; this.Dispatcher.Invoke(new Action(() => { pbPrint.Value = _NoOfPrintedTickets; this.lblErrorMsg.Content = string.Empty; this.lblPrintedTicket.Content = _NoOfPrintedTickets; this.lblTotalTicket.Content = _NoOfTickets; pbPrint.Minimum = _NoOfPrintedTickets; pbPrint.Maximum = _NoOfTickets; }), System.Windows.Threading.DispatcherPriority.Normal); long lValue = 0; if (strValue != null && strValue != string.Empty) { lValue = Convert.ToInt64(strValue.GetSingleFromString() * 100); } else { lValue = 0; } this.Dispatcher.Invoke(new Action(() => { pbPrint.Value = _NoOfPrintedTickets; }), System.Windows.Threading.DispatcherPriority.Normal); Promotional objPromotional = new Promotional(); try { while ((_NoOfPrintedTickets < _NoOfTickets) && !_mreShutdown.WaitOne(1)) { if (_mreResume.WaitOne()) { if (_mreShutdown.WaitOne(10)) { LogManager.WriteLog("Print screen was closed. So exiting now.", LogManager.enumLogLevel.Info); return; } } this.Dispatcher.Invoke(new Action(() => { lblPrintedTicket.Content = _NoOfPrintedTickets.ToString(); lblTotalTicket.Content = _NoOfTickets.ToString(); }), System.Windows.Threading.DispatcherPriority.Normal); if (true) { string strBarcode; this.Dispatcher.Invoke(new Action(() => { pbPrint.Value = _NoOfPrintedTickets; }), System.Windows.Threading.DispatcherPriority.Normal); IssueTicketEntity issueTicketEntity = new IssueTicketEntity(); issueTicketEntity.Type = UIIssueTicketConstants.STANDARDTICKET; if (PromoTicketType == 1) { issueTicketEntity.TicketHeader = "PLAYABLE VOUCHER"; } else if (PromoTicketType == 0) { issueTicketEntity.TicketHeader = "CASHABLE PROMO VOUCHER"; } else { issueTicketEntity.TicketHeader = "CASH DESK VOUCHER"; } LogManager.WriteLog("Ticket Header : " + issueTicketEntity.TicketHeader, LogManager.enumLogLevel.Info); // issueTicketEntity.VoidDate = DateTime.Now.ToString();// (Convert.ToDateTime(this.ExpiryDate, new CultureInfo(ExtensionMethods.CurrentDateCulture))).ToString(); issueTicketEntity.VoidDate = (Convert.ToDateTime(this.ExpiryDate, new CultureInfo(ExtensionMethods.CurrentDateCulture))).ToString(); issueTicketEntity.dblValue = Convert.ToDouble(this.PromotionTicketAmount, new CultureInfo(ExtensionMethods.CurrentCurrenyCulture));; issueTicketEntity.lnglValue = long.Parse((this.PromotionTicketAmount * 100).ToString()); System.TimeSpan ts = (ExpiryDate).Subtract(DateTime.Now); issueTicketEntity.NumberOfDays = ts.Days; // issueTicketEntity.Date = DateTime.Now; string PrintedDateTime = string.Empty; //PrintedDateTime = (Convert.ToDateTime(System.DateTime.Now, new CultureInfo(ExtensionMethods.CurrentDateCulture))).ToString(); issueTicketEntity.Date = DateTime.Now;//Convert.ToDateTime(PrintedDateTime); PrintTicketErrorCodes PrintResult = objCashDeskOperator.IssueTicket(issueTicketEntity); strBarcode = issueTicketEntity.BarCode; this.Dispatcher.Invoke(new Action(() => { this.lblErrorMsg.Visibility = Visibility.Visible; this.pbPrint.Visibility = Visibility.Visible; this.lblPrintedTicket.Visibility = Visibility.Visible; this.lblTotalTicket.Visibility = Visibility.Visible; this.btnCancel.Visibility = Visibility.Visible; this.btnPause.Visibility = Visibility.Visible; switch (PrintResult) { case PrintTicketErrorCodes.OpenCOMPortFailure: { _FailureTickets++; // MessageBox.ShowBox("MessageID295", BMC_Icon.Warning); //Unable to open COM Port. Please check connectivity. lblErrorMsg.Content = "Unable to open COM Port. Please check connectivity"; return; } case PrintTicketErrorCodes.OutofPaper: { _FailureTickets++; // MessageBox.ShowBox("MessageID294", BMC_Icon.Warning); //out of Paper lblErrorMsg.Content = "Out of Paper"; return; } case PrintTicketErrorCodes.Success: { lblErrorMsg.Content = string.Empty; _SucceededTickets++; pbPrint.Value = _NoOfPrintedTickets; if (!String.IsNullOrEmpty(DisplayTicketPrintedSuccessMsg)) { if (DisplayTicketPrintedSuccessMsg.ToUpper().Trim() == "TRUE") { lblErrorMsg.Content = " Voucher printed successfully"; } } _NoOfPrintedTickets += 1; pbPrint.Value = _NoOfPrintedTickets; lblPrintedTicket.Content = _NoOfPrintedTickets.ToString(); int UpdateVoucherPromotionID = objPromotional.BUpdateVoucherPromotion(this.PromotionID, strBarcode); //Update PromotionalID in Voucher Table break; } case PrintTicketErrorCodes.eVoltErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr1", BMC_Icon.Error); lblErrorMsg.Content = "Voltage Error"; return; } case PrintTicketErrorCodes.eHeadErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr2", BMC_Icon.Error); lblErrorMsg.Content = " Printer Head Error"; return; } case PrintTicketErrorCodes.ePaperOut: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr3", BMC_Icon.Error); lblErrorMsg.Content = "Out of Paper"; return; } case PrintTicketErrorCodes.ePlatenUP: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr4", BMC_Icon.Error); lblErrorMsg.Content = "Platen Up"; return; } case PrintTicketErrorCodes.eSysErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr5", BMC_Icon.Error); lblErrorMsg.Content = "System Error"; return; } case PrintTicketErrorCodes.eBusy: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr6", BMC_Icon.Error); lblErrorMsg.Content = "Printer is Busy"; return; } case PrintTicketErrorCodes.eJobMemOF: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr7", BMC_Icon.Error); lblErrorMsg.Content = "Job Memory off"; return; } case PrintTicketErrorCodes.eBufOF: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr8", BMC_Icon.Error); lblErrorMsg.Content = "Buffer off"; return; } case PrintTicketErrorCodes.eLibLoadErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr9", BMC_Icon.Error); lblErrorMsg.Content = "Library Load Error"; return; } case PrintTicketErrorCodes.ePRDataErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr10", BMC_Icon.Error); lblErrorMsg.Content = "Printer Data Error"; return; } case PrintTicketErrorCodes.eLibRefErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr11", BMC_Icon.Error); lblErrorMsg.Content = "Library Reference Error"; return; } case PrintTicketErrorCodes.eTempErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr12", BMC_Icon.Error); lblErrorMsg.Content = "Temp Error"; return; } case PrintTicketErrorCodes.eMissingSupplyIndex: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr13", BMC_Icon.Error); lblErrorMsg.Content = "Supply Index is Missing"; return; } case PrintTicketErrorCodes.eFlashProgErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr14", BMC_Icon.Error); lblErrorMsg.Content = "Flash Program Error"; return; } case PrintTicketErrorCodes.ePaperInChute: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr15", BMC_Icon.Error); lblErrorMsg.Content = "Paper in Chute"; return; } case PrintTicketErrorCodes.ePrintLibCorr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr16", BMC_Icon.Error); lblErrorMsg.Content = "Print library is corrupted."; return; } case PrintTicketErrorCodes.eCmdErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr17", BMC_Icon.Error); lblErrorMsg.Content = "Command Error"; return; } case PrintTicketErrorCodes.ePaperLow: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr18", BMC_Icon.Error); lblErrorMsg.Content = "Paper low."; return; } case PrintTicketErrorCodes.ePaperJam: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr19", BMC_Icon.Error); lblErrorMsg.Content = "Paper jammed."; return; } case PrintTicketErrorCodes.eCurrentErr: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr20", BMC_Icon.Error); lblErrorMsg.Content = "Current Error"; return; } case PrintTicketErrorCodes.eJournalPrint: { _FailureTickets++; // MessageBox.ShowBox("MsgPromErr21", BMC_Icon.Error); lblErrorMsg.Content = "Journal Print Error"; return; } default: { _FailureTickets++; // MessageBox.ShowBox("MessageID102", BMC_Icon.Warning); lblErrorMsg.Content = "Unable to Print Voucher"; return; } } }), System.Windows.Threading.DispatcherPriority.Normal); this.Dispatcher.Invoke(new Action(() => { this.lblPrintedTicket.Content = _NoOfPrintedTickets.ToString(); this.lblTotalTicket.Content = _NoOfTickets.ToString(); UpdateProgressBarDelegate updatePbDelegate = new UpdateProgressBarDelegate(pbPrint.SetValue); }), System.Windows.Threading.DispatcherPriority.Normal); this.Dispatcher.Invoke(new Action(() => { btnCancel.IsEnabled = true; }), System.Windows.Threading.DispatcherPriority.Normal); System.Threading.Thread.Sleep(1000); } PromoTickAmt = Convert.ToDouble(_PromotionTicketAmount); PromCount = Convert.ToInt32(_NoOfTickets); double TotalAmoount = PromCount * PromoTickAmt; if (_NoOfPrintedTickets == _NoOfTickets) { int UpdateVoucherPrintSuccess = objPromotional.MarkPromotionalTicketsAsValid(this.PromotionID, 1); this.Dispatcher.Invoke(new Action(() => { this.lblErrorMsg.Content = string.Empty; pbPrint.Value = _NoOfPrintedTickets; MessageBox.ShowBox("MessageID435", BMC_Icon.Information); }), System.Windows.Threading.DispatcherPriority.Normal); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Promotion, Audit_Screen_Name = "Promo Print", Audit_Desc = "Promo Name: " + PromoName + "; TicketAmount: " + _PromotionTicketAmount.ToString() + "; Number of Tickets: " + PromCount.ToString() + "; Total Promotion Amount: " + TotalAmoount.ToString() + "; Expiry Date: " + ExpiryDate, AuditOperationType = OperationType.ADD, Audit_New_Vl = PromoName }); this.Dispatcher.Invoke(new Action(() => { IsPrintedCompleted = true; }), System.Windows.Threading.DispatcherPriority.Normal); } } } catch (Exception ex) { ExceptionManager.Publish(ex); LogManager.WriteLog("Promotional Print Tickets : " + ex.Message, LogManager.enumLogLevel.Error); } finally { } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
private void SaveManualHandpay() { if (cmbBarPositions.SelectedIndex <= 0) { return; } Window Owner; double amount = 0; int Auth_User_ID = 0; try { CAuthorize objAuthorize = null; if (txtBox != null && txtBox.Text.Length > 0) { // Issue fix for ->set cultureinfo='en-US', currencyculture='it-IT' double.TryParse(txtBox.Text.ToString(), NumberStyles.Currency, new CultureInfo(ExtensionMethods.CurrentCurrenyCulture), out amount); } Auth_User_ID = Security.SecurityHelper.CurrentUser.User_No; if (Settings.Client != null && Settings.Client.ToLower() == "winchells" && Settings.MaxHandPayAuthRequired && txtBox != null && (amount > Settings.HandpayPayoutCustomer_Max)) { objAuthorize = new CAuthorize("CashdeskOperator.Authorize.cs.MaxHandpay"); Auth_User_ID = Security.SecurityHelper.CurrentUser.User_No; if (!Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.MaxHandpay")) { objAuthorize.ShowDialogEx(this); if (!objAuthorize.IsAuthorized) { IsProcessed = true; return; } else { Auth_User_ID = handpay.GetUserID(objAuthorize.User.SecurityUserID); } } else { objAuthorize.IsAuthorized = true; } } if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS") { if (txtBox != null) { Custid = 0; ProcessCancelled = false; if (amount >= Settings.HandpayPayoutCustomer_Min && amount <= Settings.HandpayPayoutCustomer_Max) { oCustomerDetails = new BMC.Presentation.POS.Views.CustomerDetails(); oCustomerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); oCustomerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); Owner = Window.GetWindow(this); oCustomerDetails.ShowDialogEx(this); } else if (amount >= Settings.HandpayPayoutCustomer_BankAccNo) { oCustomerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true); oCustomerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); oCustomerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); Owner = Window.GetWindow(this); oCustomerDetails.ShowDialogEx(this); } else if (amount >= Settings.HandpayPayoutCustomer_Max && amount <= Settings.HandpayPayoutCustomer_BankAccNo) { oCustomerDetails = new BMC.Presentation.POS.Views.CustomerDetails(); oCustomerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); oCustomerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); Owner = Window.GetWindow(this); oCustomerDetails.ShowDialogEx(this); } } if (ProcessCancelled) // if the process cancelled from the customer then back to the handpay screen { return; } } List <AssetNumberResult> lstasset = handpay.GetAssetNumber((cmbBarPositions.SelectedItem as BarPositions).Installation_No); string Asset = lstasset[0].Stock_No; treasury = new Treasury { InstallationNumber = (cmbBarPositions.SelectedItem as BarPositions).Installation_No }; if (optHandpay.IsChecked == true) { treasury.TreasuryType = "AttendantPay Credit"; } else if (optJackpot.IsChecked == true) { treasury.TreasuryType = "AttendantPay Jackpot"; } else { treasury.TreasuryType = "PROGRESSIVE"; } treasury.TreasuryAmount = amount; treasury.ActualTreasuryDate = DateTime.Now; // treasury.UserID = Security.SecurityHelper.CurrentUser.User_No; treasury.UserID = Auth_User_ID; treasury.Authorized_Date = DateTime.MinValue.DBMinValue(); if (objAuthorize != null && objAuthorize.IsAuthorized) { treasury.AuthorizedUser_No = Auth_User_ID; treasury.Authorized_Date = DateTime.Now; //Audit for authorization AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ManualAttendantPay, Audit_Screen_Name = "PositionDetails|ManualAttendantPay", Audit_Desc = "Manual AttendantPay Type-" + treasury.TreasuryType, AuditOperationType = OperationType.ADD, Audit_Field = "AuthorizedUser_No", Audit_New_Vl = Auth_User_ID.ToString(), Audit_Slot = Asset }); } treasury.CustomerID = Custid; // add the customer to the treasury if amt between 1000 & 4000 or >5000 Treasury_No = handpay.ProcessHandPay(treasury, 0); IsProcessed = true; if (Treasury_No > 0) { DateTime dtTreasury = (DateTime)handpay.GetTreasuryDateTime(Treasury_No); TextBlock_11.Text = "#" + (cmbBarPositions.SelectedItem as BarPositions).Bar_Pos_Name + dtTreasury.ToString("ddMMyyyyHHmmss"); txtAmount.Text = Convert.ToDecimal((treasury.TreasuryAmount)).GetUniversalCurrencyFormat(); #region GCD if (Settings.IsGloryCDEnabled && Settings.CashDispenserEnabled) { LoadingWindow ld = new LoadingWindow(Window.GetWindow(this), ModuleName.ManualAttendantPay, Treasury_No.ToString(), (cmbBarPositions.SelectedItem as BarPositions).Bar_Pos_Name, Convert.ToInt32(treasury.TreasuryAmount * 100)); ld.Topmost = true; ld.ShowDialogEx(this); Result res = ld.Result; if (res.IsSuccess && (Treasury_No > 0)) { LogManager.WriteLog(string.Format("Cash Dispensed Successfully - Treasury Amount: {0:0.00}", treasury.TreasuryAmount), LogManager.enumLogLevel.Info); LogManager.WriteLog("Export Manual AttendantPay Details to Enterprise", LogManager.enumLogLevel.Info); handpay.ExportHandPay(Treasury_No); BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.AttendantPay, Audit_Screen_Name = "PositionDetails|AttendantPay|Manual HandPay", Audit_Desc = "Manual HandPay Succeed", AuditOperationType = OperationType.ADD, Audit_Old_Vl = "Ticket_ExceptionID:0 (Manual Handpay); TreasuryNo:" + Treasury_No + ";", }); } else { BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true); LogManager.WriteLog(string.Format("Unable to Dispense Cash - Treasury Amount: {0:0.00}", treasury.TreasuryAmount), LogManager.enumLogLevel.Info); LogManager.WriteLog("Rollback Manual HandPay Process", LogManager.enumLogLevel.Info); handpay.RollbackHandPay(0, Treasury_No); MessageBox.ShowBox("MessageID117", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.AttendantPay, Audit_Screen_Name = "PositionDetails|AttendantPay", Audit_Desc = treasury.TreasuryType + " processing was not completed.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.AttendantPay, Audit_Screen_Name = "PositionDetails|AttendantPay|Manual HandPay Process Failed", Audit_Desc = "Rollback HandPay Process Voucher due to cash dispenser error", AuditOperationType = OperationType.MODIFY, Audit_Old_Vl = "Ticket_ExceptionID:0 (Manual Handpay); TreasuryNo:" + Treasury_No + ";" }); } } else { this.ProcessCashDispense("Manual AttendantPay Type", treasury.TreasuryType, Convert.ToDecimal(amount)); MessageBox.ShowBox("MessageID116", BMC_Icon.Information); } #endregion AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ManualAttendantPay, Audit_Screen_Name = "PositionDetails|ManualAttendantPay", Audit_Desc = "Manual AttendantPay Type-" + treasury.TreasuryType, AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = String.Format("{0:0.00}", treasury.TreasuryAmount), Audit_Slot = Asset }); if (txtBox != null) { //txtBox.Text = "0.00"; txtBox.Text = this.DefaultAmount(); ucValueCalcComp.s_UnformattedText = ""; } if (objAuthorize != null && objAuthorize.User != null) { (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, treasury.TreasuryType, Treasury_No.ToString(), objAuthorize.User); } else { (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, treasury.TreasuryType, Treasury_No.ToString()); } if (((bool)optJackpot.IsChecked) || ((bool)optProgressive.IsChecked))// || ((bool)optHandpay.IsChecked)) { treasury.Asset = Asset; //string installationType = installationPathkey.GetValue("InstallationType").ToString(); //if (installationType.ToUpper().Equals("EXCHANGECLIENT")) //{ // if (Settings.SendPT10FromClient) // PostHandpayEvent(treasury); //} //else PostHandpayEvent(treasury); } } else { if (optHandpay.IsChecked == true) { MessageBox.ShowBox("MessageID119", BMC_Icon.Error); } else if (optJackpot.IsChecked == true) { MessageBox.ShowBox("MessageID1191", BMC_Icon.Error); } else { MessageBox.ShowBox("MessageID1192", BMC_Icon.Error); } AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ManualAttendantPay, Audit_Screen_Name = "PositionDetails|ManualAttendantPay", Audit_Desc = "Manual AttendantPay Type-" + treasury.TreasuryType + " processing was not completed.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } } catch (Exception Ex) { ExceptionManager.Publish(Ex); MessageBox.ShowBox("MessageID119", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ManualAttendantPay, Audit_Screen_Name = "PositionDetails|ManualAttendantPay", Audit_Desc = "Manual AttendantPay Type-" + treasury.TreasuryType + " processing was not completed.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { btnSave.IsEnabled = false; int retValue; if (txtAddNotes.Text == "") { MessageBox.ShowBox("MessageID149", BMC_Icon.Information); return; } if (MessageBox.ShowBox("MessageID150", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.Yes) { retValue = fieldService.InsertServiceNotes(txtJobID.Text, txtAddNotes.Text, Security.SecurityHelper.CurrentUser.UserName); if (retValue > 0) { MessageBox.ShowBox("MessageID151", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Review Notes for " + txtJobID.Text + " has been updated", AuditOperationType = OperationType.ADD, Audit_Slot = Asset, Audit_Field = "JOB ID", Audit_New_Vl = txtJobID.Text }); } else { MessageBox.ShowBox("MessageID152", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Failed while adding a note", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } BindControl(false, txtJobID.Text); } btnSave.Visibility = Visibility.Hidden; if (!Security.SecurityHelper.HasAccess("BMC.Presentation.CFieldService.btnReview.AddNote")) { btnAdd.Visibility = Visibility.Hidden; } else { btnAdd.Visibility = Visibility.Visible; } btnCancel.Content = FindResource("CTicketEntry_xaml_Button_12"); txtAddNotes.IsReadOnly = true; btnAdd.Focus(); } finally { btnSave.IsEnabled = true; } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { int iReasonID = 0; btnSave.IsEnabled = false; if (!CheckData()) { return; } int iSelectedInstallation = 0; int iSelectedReasoncode = 0; string strExceptionDetails = string.Empty; int iExceptionCode = 0; string strExpectedStatus = string.Empty; string strReason = ""; string strComment = ""; IHandpay IUser_No = HandpayBusinessObject.CreateInstance(); int AuthorizedUserNo = Security.SecurityHelper.CurrentUser.User_No; DataRowView drv = (DataRowView)lstInstallation.SelectedItem; iSelectedInstallation = Convert.ToInt32(drv["Installation_No"]); if (lvReason.SelectedIndex >= 0) { iSelectedReasoncode = 0; drv = (DataRowView)lvReason.SelectedItem; iSelectedReasoncode = Convert.ToInt32(drv[0]); } else { if (lvReason.Items.SourceCollection is System.Data.DataView) { DataView dvReason = (DataView)lvReason.Items.SourceCollection; DataTable dtReason = new DataTable(); dtReason = dvReason.ToTable().Copy(); DataView dvReasonClone = new DataView(dtReason); dvReasonClone.RowFilter = "ReasonDescription='" + txtComments.Text + "'"; if (dvReasonClone.ToTable().Rows.Count > 0) { iSelectedReasoncode = Convert.ToInt32(dvReasonClone.ToTable().Rows[0]["ReasonCode"]); } else { iSelectedReasoncode = lvReason.Items.Count + 1; } } } double dValue = Convert.ToDouble(objValueCalc.txtDisplay.Text); bool blnTicketFoundinException = false; IShortPay objCashDesk = ShortPayBusinessObject.CreateInstance(); BMC.Transport.CashDeskOperatorEntity.Treasury objTreasuries = new BMC.Transport.CashDeskOperatorEntity.Treasury(); objTreasuries.InstallationNumber = iSelectedInstallation; objTreasuries.UserID = Security.SecurityHelper.CurrentUser.User_No; objTreasuries.TreasuryType = "Shortpay"; objTreasuries.TreasuryReasonCode = iSelectedReasoncode; if (lvReason.SelectedIndex >= 0) { DataRowView drvReason = (DataRowView)lvReason.SelectedItem; strReason = drvReason[1].ToString(); strComment = strReason + ". Voucher Number is" + txtTicketNumber.Text; } else { objReasonCode.Reason_Code = iSelectedReasoncode; objReasonCode.ReasonDescription = txtComments.Text; if (!String.IsNullOrEmpty(txtComments.Text)) { if (Settings.AddShortpayCommentstoDefault) { iReasonID = objCashDesk.SaveReasonDetails(objReasonCode); } strComment = txtComments.Text + " . Voucher Number is " + txtTicketNumber.Text; strReason = txtComments.Text; objTreasuries.TreasuryReason = strComment; } } if (strComment.Length > 199) { objTreasuries.TreasuryReason = strComment.Substring(0, 199); } else { objTreasuries.TreasuryReason = strComment; } objTreasuries.TreasuryAmount = dValue; objTreasuries.TreasuryIssuerUserNo = AuthorizedUserNo; int iShortPayID = 0; int UserSecurityId = 0; if (BMC.Transport.Settings.ShortPayAuthorizationRequired && objTreasuries.TreasuryAmount >= BMC.Transport.Settings.ShortPayAuthorizationLimit) { if (objCashDesk.CreateShortPayForApproval(objTreasuries, ref iShortPayID)) { LogManager.WriteLog("Shortpay saved for authorization. Ticketnumber: " + txtTicketNumber.Text, LogManager.enumLogLevel.Info); } else { LogManager.WriteLog("Unable to save Shortpay authorization. Ticketnumber: " + txtTicketNumber.Text, LogManager.enumLogLevel.Info); MessageBox.ShowBox("MessageID198"); return; } CAuthorize oCAuthorize = new CAuthorize("BMC.Presentation.CShortPay.ShortPayApprover"); oCAuthorize.ShowDialog(); if (!oCAuthorize.IsAuthorized) { objCashDesk.CancelShortPayForApproval(iShortPayID); return; } bIsAuthorised = true; AuthorisedUsr = oCAuthorize.User; UserSecurityId = oCAuthorize.User.SecurityUserID; AuthorizedUserNo = IUser_No.GetUserID(UserSecurityId); } //Update user no with authorized user if shortpay is authorised by different user objTreasuries.TreasuryIssuerUserNo = AuthorizedUserNo; objTreasuries.AuthorizedUser_No = AuthorizedUserNo; objTreasuries.Authorized_Date = DateTime.Now; int iTreasuryID = objCashDesk.SaveShortpayDetails(objTreasuries); if (iShortPayID > 0) { objCashDesk.ApproveShortPay(iShortPayID.ToString(), UserSecurityId, iTreasuryID); } if (iTreasuryID > 0) { LogManager.WriteLog("Shortpay saved in treasury. Ticketnumber: " + txtTicketNumber.Text, LogManager.enumLogLevel.Info); if (iReasonID > 0) { LogManager.WriteLog("ReasonCode saved in Reason_Code. ReasonCode: " + objReasonCode.Reason_Code, LogManager.enumLogLevel.Info); } } else { LogManager.WriteLog("Unable to save Shortpay in treasury. Ticketnumber: " + txtTicketNumber.Text, LogManager.enumLogLevel.Info); return; } strExceptionDetails = "Normal Treasury Entry"; iExceptionCode = (int)ShortpayExceptionCodes.NormalTreasuryEntry; IHandpay handpay = HandpayBusinessObject.CreateInstance(); DataTable dtException = handpay.GetTicketingExceptionTable(txtTicketNumber.Text); if (dtException.Rows.Count > 0) { LogManager.WriteLog("Voucher Number :" + txtTicketNumber.Text + " found in Ticket_Exception table.", LogManager.enumLogLevel.Info); strExpectedStatus = dtException.Rows[0]["TE_Status_Create_Expected"].ToString(); blnTicketFoundinException = true; if (objCashDesk.UpdateTicketException(0, txtTicketNumber.Text, "V") == 0) { LogManager.WriteLog("Ticket Exception table updated. Voucher Number:" + txtTicketNumber.Text, LogManager.enumLogLevel.Info); } strExceptionDetails = "House Keeping Void"; iExceptionCode = (int)ShortpayExceptionCodes.HouseKeepingVoid; } if (blnTicketFoundinException && !string.IsNullOrEmpty(strExpectedStatus)) { if (strExpectedStatus == "VOID_SP" || strExpectedStatus == "ACTIVE") { BMC.Transport.CashDeskOperatorEntity.VoidOrExpiredTreasury objVoidTreasury = new BMC.Transport.CashDeskOperatorEntity.VoidOrExpiredTreasury(); objVoidTreasury.TicketNumber = txtTicketNumber.Text; objVoidTreasury.TransactionType = "Shortpay"; objVoidTreasury.TreasuryReason = "Voiding Voucher for ShortPay"; objCashDesk.UpdateVoidorExpiredTreasury(objVoidTreasury); LogManager.WriteLog("Updated void or expired treasury. Ticketnumber: " + txtTicketNumber.Text, LogManager.enumLogLevel.Info); strExceptionDetails = "Voiding Vocuher for ShortPay"; iExceptionCode = (int)ShortpayExceptionCodes.VoidTicketForShortpay; } } if (!blnTicketFoundinException) { strExceptionDetails = "No entry found in ticket_exception table for the Voucher entered"; iExceptionCode = (int)ShortpayExceptionCodes.NoEntryInTicket_Exception; } Transport.CashDeskOperatorEntity.TicketException objException = new BMC.Transport.CashDeskOperatorEntity.TicketException(); objException.InstallationNumber = iSelectedInstallation; objException.ExceptionDetails = strExceptionDetails; objException.ExceptionType = iExceptionCode; objException.Reference = txtTicketNumber.Text; objException.User = AuthorizedUserNo; objCashDesk.InsertException(objException); LogManager.WriteLog("Voucher inserted into Exception. Voucher Number :" + txtTicketNumber.Text, LogManager.enumLogLevel.Info); //MachineDetails.Value = dValue.ToString(); //MachineDetails.TreasuryNo = iTreasuryID.ToString(); string sDesc = "Position: " + ((System.Data.DataRowView)(lstInstallation.SelectedValue)).Row.ItemArray[0].ToString() + " Details: " + strReason + " TicketNo.: " + txtTicketNumber.Text + " Amount: " + dValue; sDesc += bIsAuthorised ? " Approved By : " + AuthorisedUsr.UserName : ""; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Shortpay, Audit_Screen_Name = "Shortpay", Audit_Desc = sDesc, AuditOperationType = OperationType.ADD, Audit_Field = "Shortpay ", Audit_New_Vl = "NULL" }); MessageBox.ShowBox("MessageID197"); LoadControls(); lstInstallation.Focus(); if (dtInstallations.Rows.Count > 0) { lstInstallation.SelectedIndex = 0; } //To Print Receipt. if (!bIsAuthorised) { (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, "Shortpay", iTreasuryID.ToString()); } else { (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, "Shortpay", iTreasuryID.ToString(), AuthorisedUsr); } AuthorisedUsr = null; bIsAuthorised = false; LogManager.WriteLog("Recipt printed for shortpay. Voucher Number :" + txtTicketNumber.Text, LogManager.enumLogLevel.Info); } catch (Exception ex) { ExceptionManager.Publish(ex); MessageBox.ShowBox("MessageID198"); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Shortpay, Audit_Screen_Name = "Shortpay", Audit_Desc = "Exception Occured while saving the Data", AuditOperationType = OperationType.ADD, Audit_Field = "Shortpay ", Audit_New_Vl = "NULL" }); } finally { btnSave.IsEnabled = true; } }
private void btn_Update_Click(object sender, RoutedEventArgs e) { try { string strIDs = string.Empty; btn_Update.IsEnabled = false; pgBarExportDetails.Visibility = Visibility.Visible; txtPGStatusExportDetails.Visibility = Visibility.Visible; if (oUnExportedData != null) { oUnExportedData.ForEach(x => { if (x.IsSelected == true) { strIDs = strIDs + "," + x.ID.ToString(); } }); } strIDs = strIDs.TrimStart(','); if (strIDs.Length > 0) { UpdateProgressStatus("MessageID539", 5); if (ServiceStatus(true)) { try { UpdateProgressStatus("MessageID540", 33); if (strIDs.Length > 0) { int iStatus = ((StatusType)cmbStatusType.SelectedItem).Type; if (iStatus == 100) { if (MessageBox.ShowBox("MessageID501", BMC_Icon.Information, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.No) { return; } } LogManager.WriteLog("Export Details: btn_Update_Click Updating Export Status of : " + strIDs + " to " + iStatus.ToString(), LogManager.enumLogLevel.Debug); UpdateProgressStatus("MessageID541", 38); oExportDetailObject.UpdateUnExportedData(iStatus, strIDs); UpdateProgressStatus("MessageID542", 66); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.ExportDetail, Audit_Screen_Name = "Export Detail", Audit_Desc = "Export status for EH_ID : " + strIDs + " has be modified", AuditOperationType = OperationType.MODIFY, Audit_Field = "EH_Status", Audit_Old_Vl = "NULL OR -1", Audit_New_Vl = iStatus.ToString() }); RefreshUnExportedList(); } } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { UpdateProgressStatus("MessageID543", 71); ServiceStatus(false); UpdateProgressStatus("MessageID544", 100); } } else { UpdateProgressStatus("MessageID545", 0); } } else { MessageBox.ShowBox("MessageID502", BMC_Icon.Information, BMC_Button.OK); } } catch (Exception Ex) { MessageBox.ShowBox("MessageID538", BMC_Icon.Error, BMC_Button.OK); ExceptionManager.Publish(Ex); } finally { btn_Update.IsEnabled = true; pgBarExportDetails.Visibility = Visibility.Collapsed; txtPGStatusExportDetails.Visibility = Visibility.Collapsed; } }
private void button_Click(object sender, RoutedEventArgs e) { bool isValid = false; RTOnlineTicketDetail objTicketDetail = null; double redeemTicketAmount = 0; bool IsCashDispenseError = false; try { if (isScannerFired) //check done not to fire the verify event twice while verifying a ticket using scanner { isScannerFired = false; return; } ClearAll(true); TextBlock_11.Text = string.Empty; txtAmount.Text = string.Empty; btnVerify.IsEnabled = false; if ((sender is System.Windows.Controls.TextBox)) { isScannerFired = true; } else { isScannerFired = false; } if (this.ucValueCalc.txtDisplay.Text.Trim().Length > 0) { if (this.ucValueCalc.txtDisplay.Text.Trim().Length < 4) { MessageBox.ShowBox("MessageID403", BMC_Icon.Error); this.txtStatus.Visibility = Visibility.Hidden; this.ucValueCalc.txtDisplay.Text = String.Empty; return; } IRedeemOnlineTicket objCashDeskOper = RedeemOnlineTicketBusinessObject.CreateInstance(); objTicketDetail = new RTOnlineTicketDetail(); objTicketDetail.ClientSiteCode = Settings.SiteCode; objTicketDetail.TicketString = this.ucValueCalc.txtDisplay.Text.Trim(); objTicketDetail.HostSiteCode = objTicketDetail.TicketString.Substring(0, 4); objTicketDetail.RedeemedMachine = System.Environment.MachineName; objTicketDetail = objCashDeskOper.GetRedeemTicketAmount(objTicketDetail); if (objTicketDetail.TicketStatusCode == -990) //TIS Error (If any) { MessageBox.ShowBox(objTicketDetail.TicketErrorMessage, BMC_Icon.Error, true); disptimerRedeem.Stop(); this.txtStatus.Visibility = Visibility.Hidden; return; } if (objTicketDetail.TicketStatusCode == -234) //Exception Occured { MessageBox.ShowBox("MessageID425", BMC_Icon.Error); disptimerRedeem.Stop(); this.txtStatus.Visibility = Visibility.Hidden; return; } if (objTicketDetail.TicketStatusCode == -99) //Included for Cross Ticketing { MessageBox.ShowBox("MessageID403", BMC_Icon.Error); disptimerRedeem.Stop(); this.txtStatus.Visibility = Visibility.Hidden; this.ucValueCalc.txtDisplay.Text = String.Empty; return; } if (objTicketDetail.TicketStatusCode == 250) //Any/specific player card required for TIS { bool ValidCard = false; int PlayerCardClose = 0; if (objTicketDetail.CardRequired == 2) { PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired); objPlayerCardValidation.ShowDialogEx(this); ValidCard = objPlayerCardValidation.valid; PlayerCardClose = objPlayerCardValidation.Close; if (PlayerCardClose == 1) { this.ucValueCalc.txtDisplay.Text = String.Empty; this.ucValueCalc.txtDisplay.Focus(); return; } else if (!ValidCard) { MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error); this.ucValueCalc.txtDisplay.Text = String.Empty; this.ucValueCalc.txtDisplay.Focus(); return; } } else if (objTicketDetail.CardRequired == 1) { PlayerCardValidation objPlayerCardValidation = new PlayerCardValidation(objTicketDetail.CardRequired, objTicketDetail.PlayerCardNumber); objPlayerCardValidation.ShowDialogEx(this); ValidCard = objPlayerCardValidation.valid; PlayerCardClose = objPlayerCardValidation.Close; if (PlayerCardClose == 1) { this.ucValueCalc.txtDisplay.Text = String.Empty; this.ucValueCalc.txtDisplay.Focus(); return; } else if (!ValidCard) { MessageBox.ShowBox("PlayerCardRedeem6", BMC_Icon.Error); this.ucValueCalc.txtDisplay.Text = String.Empty; this.ucValueCalc.txtDisplay.Focus(); return; } } objTicketDetail.TicketStatusCode = 0; } int ticketAmount = Convert.ToInt32(objTicketDetail.RedeemedAmount); redeemTicketAmount = ticketAmount / 100; objTicketDetail.CustomerId = Custid; this.txtStatus.Visibility = Visibility.Visible; this.txtStatus.Text = "VALIDATING."; disptimerRedeem.IsEnabled = true; disptimerRedeem.Start(); //if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == 0) && (Settings.RedeemConfirm)) if (objTicketDetail.TicketStatusCode == 0 && (Settings.RedeemConfirm)) { disptimerRedeem.Stop(); if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo); } else { _diagResult = System.Windows.Forms.DialogResult.Yes; } if (_diagResult == System.Windows.Forms.DialogResult.Yes) { #region ITALY CODE COMMENTED //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS") //{ // ProcessCancelled = false; // if (ticketStatus == 0) // { // if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max) // { // customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(); // customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); // customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); // Owner = Window.GetWindow(this); // customerDetails.ShowDialog(); // } // else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo) // { // customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true); // customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); // customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); // Owner = Window.GetWindow(this); // customerDetails.ShowDialog(); // } // if (ProcessCancelled) // { // MessageBox.ShowBox("MessageID299", BMC_Icon.Information); // this.ucValueCalc.txtDisplay.Text = string.Empty; // return; // } // } //} #endregion objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail); isValid = objTicketDetail.ValidTicket; } else { disptimerRedeem.Start(); this.txtStatus.Visibility = Visibility.Hidden; return; } disptimerRedeem.Start(); } //else if ((objCashDeskOper.CheckSDGTicket(objTicketDetail.TicketString) == -3) && (Settings.RedeemConfirm) else if (objTicketDetail.TicketStatusCode == -3 && (Settings.RedeemConfirm) && Settings.RedeemExpiredTicket) { disptimerRedeem.Stop(); CAuthorize objAuthorize = null; //Manoj 26th Aug 2010. CR383384 //RedeemExpiredTicket functionality has been implmented for Winchells. //So, in settings RedeemExpiredTicket will be True for Winchells, for rest it will be False. //So we dont need the following if condition. //if (Settings.Client != null && Settings.Client.ToLower() == "winchells") //{ objAuthorize = new CAuthorize("CashdeskOperator.Authorize.cs.ReedemExpiredTicket"); objAuthorize.User = Security.SecurityHelper.CurrentUser; string Cur_User_Name = Security.SecurityHelper.CurrentUser.Last_Name + ", " + Security.SecurityHelper.CurrentUser.First_Name; objTicketDetail.RedeemedUser = Cur_User_Name; if (!Security.SecurityHelper.HasAccess("CashdeskOperator.Authorize.cs.ReedemExpiredTicket")) { objAuthorize.ShowDialogEx(this); string Auth_User_Name = objAuthorize.User.UserName; if (objAuthorize.User.Last_Name != null && objAuthorize.User.First_Name != null) { Auth_User_Name = objAuthorize.User.Last_Name + ", " + objAuthorize.User.First_Name; } else { Auth_User_Name = objAuthorize.User.UserName; } objTicketDetail.RedeemedUser = Auth_User_Name; if (!objAuthorize.IsAuthorized) { ClearAll(false); return; } } else { objAuthorize.IsAuthorized = true; } //} if (objAuthorize != null && objAuthorize.IsAuthorized) { objTicketDetail.AuthorizedUser_No = objAuthorize.User.SecurityUserID; objTicketDetail.Authorized_Date = DateTime.Now; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Voucher, Audit_Screen_Name = "Vouchers|RedeemVoucher", Audit_Desc = "Voucher Number-" + objTicketDetail.TicketString, AuditOperationType = OperationType.MODIFY, Audit_Field = "AuthorizedUser_No", Audit_New_Vl = Security.SecurityHelper.CurrentUser.SecurityUserID.ToString() }); } if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { _diagResult = MessageBox.ShowBox("MessageID225", BMC_Icon.Question, BMC_Button.YesNo); } else { _diagResult = System.Windows.Forms.DialogResult.Yes; } if (_diagResult == System.Windows.Forms.DialogResult.Yes) { #region ITALY CODE COMMENTED //if (Settings.RegulatoryEnabled == true && Settings.RegulatoryType == "AAMS") //{ // ProcessCancelled = false; // if (ticketStatus == 0) // { // if (redeemTicketAmount >= Settings.RedeemTicketCustomer_Min && redeemTicketAmount <= Settings.RedeemTicketCustomer_Max) // { // customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(); // customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); // customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); // Owner = Window.GetWindow(this); // customerDetails.ShowDialog(); // } // else if (redeemTicketAmount >= Settings.RedeemTicketCustomer_BankAcctNo) // { // customerDetails = new BMC.Presentation.POS.Views.CustomerDetails(true); // customerDetails.delCustomerUpdated += new BMC.Presentation.POS.Views.CustomerDetails.CustomerUpdateHandler(delCustomerUpdated); // customerDetails.delCustomerCancelled += new BMC.Presentation.POS.Views.CustomerDetails.CustomerCancelHandler(delCustomerCancelled); // Owner = Window.GetWindow(this); // customerDetails.ShowDialog(); // } // if (ProcessCancelled) // { // MessageBox.ShowBox("MessageID299", BMC_Icon.Information); // this.ucValueCalc.txtDisplay.Text = string.Empty; // return; // } // } //} #endregion objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail); isValid = objTicketDetail.ValidTicket; } else { disptimerRedeem.Start(); this.txtStatus.Visibility = Visibility.Hidden; return; } disptimerRedeem.Start(); } else { objTicketDetail = objCashDeskOper.RedeemOnlineTicket(objTicketDetail); isValid = objTicketDetail.ValidTicket; } if (objTicketDetail.TicketStatus == "MessageID210") { objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString() + "(" + CommonUtilities.GetCurrency(Convert.ToDouble(objTicketDetail.TicketValue / 100)) + ")"; } else { objTicketDetail.TicketStatus = Application.Current.FindResource(objTicketDetail.TicketStatus).ToString(); } IsCashDispenseError = true; if (isValid && objTicketDetail.RedeemedMachine != null && objTicketDetail.RedeemedMachine != string.Empty) { try { //DateTime PrintDate; //string strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate); DateTime PrintDate = DateTime.Now; string strbar_pos = objCashDeskOper.GetTicketPrintDevice(objTicketDetail.TicketString, out PrintDate); //TextBlock_11.Text = "#" + strbar_pos + PrintDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", ""); //TextBlock_11.Text = "#" + objTicketDetail.PrintedDevice + objTicketDetail.PrintedDate.ToString().Replace("/", "").Replace(":", "").Replace("AM", "0").Replace("PM", "1").Replace(" ", ""); if (objTicketDetail.RedeemedDate == null || objTicketDetail.RedeemedDate.ToString().Trim().Equals(string.Empty)) { TextBlock_11.Text = string.Empty; } else { TextBlock_11.Text = "#" + strbar_pos + objTicketDetail.RedeemedDate.ToString("ddMMyyyyHHmmss"); } txtAmount.Text = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormat(); if (!objTicketDetail.TicketStatus.Trim().ToUpper().Equals("ALREADY CLAIMED")) { #region GCD if (Settings.IsGloryCDEnabled && Settings.CashDispenserEnabled) { LogManager.WriteLog(string.Format("Process Redeem Voucher: {2} for Bar Postion: {0} - Amount: {1} in cents", strbar_pos, ticketAmount, objTicketDetail.TicketString), LogManager.enumLogLevel.Info); //implement Cash Dispenser LogManager.WriteLog(string.Format("Amount: {0:0.00} Sending to Cash Dispenser ", ticketAmount), LogManager.enumLogLevel.Info); LoadingWindow ld = new LoadingWindow(Window.GetWindow(this), ModuleName.Voucher, TextBlock_11.Text, strbar_pos, ticketAmount); ld.Topmost = true; ld.ShowDialogEx(this); Result res = ld.Result; if (!res.IsSuccess) { IsCashDispenseError = false; this.txtStatus.Text = res.error.Message; LogManager.WriteLog(string.Format("Unable to Dispense Cash - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info); LogManager.WriteLog("Rollback Redeem Voucher Process", LogManager.enumLogLevel.Info); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Voucher, Audit_Screen_Name = "Vouchers|RedeemVoucher", Audit_Desc = "Rollback redeem voucher:" + objTicketDetail.TicketString + " due to cash dispenser error", AuditOperationType = OperationType.MODIFY, Audit_Old_Vl = "iPayDeviceid:" + objTicketDetail.RedeemedDevice + ";dtPaid:" + objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat() + ";Customerid:" + objTicketDetail.CustomerId.ToString() }); objCashDeskOper.RollbackRedeemTicket(objTicketDetail.TicketString); if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true); } } else { LogManager.WriteLog(string.Format("Cash Dispensed Successfully - Amount: {0}", ticketAmount), LogManager.enumLogLevel.Info); IsCashDispenseError = true; if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { BMC.Presentation.MessageBox.ShowBox(res.error.Message, res.error.MessageType.Equals("Error") ? BMC_Icon.Error : BMC_Icon.Information, true); } } } #endregion } } catch (Exception Ex) { LogManager.WriteLog("Error showing Voucher Info :" + Ex.Message, LogManager.enumLogLevel.Error); } } if (objTicketDetail.ShowOfflineTicketScreen) { int result; if (objTicketDetail.HostSiteCode == Settings.SiteCode) // Offline Tickets redemption is valid only for local site code { result = objCashDeskOper.CheckSDGOfflineTicket(objTicketDetail.TicketString); } else { result = -14; } if (result == -14)// Site Code Mismatch { this.txtStatus.Visibility = Visibility.Visible; this.txtStatus.Text = Application.Current.FindResource("MessageID312") as string; this.txtStatus.Background = System.Windows.Media.Brushes.Red; return; } else { frmRedeemOffline = new BMC.Presentation.POS.Views.CRedeemOfflineTicket(); frmRedeemOffline.TicketNumber = ucValueCalc.txtDisplay.Text.Trim(); frmRedeemOffline.ShowDialogEx(this); if (frmRedeemOffline.IsSuccessfull) { this.ucValueCalc.txtDisplay.Text = frmRedeemOffline.TicketNumber; button_Click(sender, e); } else { this.ucValueCalc.txtDisplay.Text = string.Empty; this.txtStatus.Clear(); } } } else { if (Settings.IsGloryCDEnabled && (!IsCashDispenseError)) { disptimerRedeem.Stop(); this.txtStatus.Visibility = Visibility.Visible; this.txtStatus.Background = System.Windows.Media.Brushes.Red; TextBlock_11.Text = string.Empty; txtAmount.Text = string.Empty; System.Threading.Thread.Sleep(100); //System.Threading.Thread.CurrentThread disptimerRedeem.Start(); } else { this.txtStatus.Text = objTicketDetail.TicketStatus; //"(" + CommonUtilities.GetCurrency(Convert.ToDouble(TicketDetail.TicketValue / 100)) + ")"; if (Application.Current.FindResource("MessageID219").ToString() == objTicketDetail.TicketStatus) { bisTicketExpired = true; } this.txtWarning.Text = objTicketDetail.TicketWarning; if (!objTicketDetail.ValidTicket) { this.txtStatus.Background = System.Windows.Media.Brushes.Red; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Voucher, Audit_Screen_Name = "Vouchers|RedeemVoucher", Audit_Desc = "Invalid Voucher Redemption Attempt", AuditOperationType = OperationType.MODIFY, Audit_Field = "Voucher Number", Audit_New_Vl = objTicketDetail.TicketString }); } else { this.txtStatus.Background = System.Windows.Media.Brushes.White; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Voucher, Audit_Screen_Name = "Vouchers|RedeemVoucher", Audit_Desc = "Voucher Number-" + objTicketDetail.TicketString, AuditOperationType = OperationType.ADD, Audit_Field = "Voucher Status", Audit_New_Vl = objTicketDetail.TicketStatus }); //Cross Ticketing- Insert Local Record if (!string.IsNullOrEmpty(objTicketDetail.VoucherXMLData)) { objTicketDetail.RedeemedUser = Security.SecurityHelper.CurrentUser.UserName; objCashDeskOper.ImportVoucherDetails(objTicketDetail); } if (objTicketDetail.TicketStatus.Contains(Application.Current.FindResource("MessageID210").ToString())) { //disptimerRedeem.Stop(); Action act = new Action(() => { if (Convert.ToBoolean(AppSettings.REDEEM_TICKET_POP_UP_ALERT_VISIBILITY)) { if (IsCashDispenseError) { if (Settings.IsGloryCDEnabled) { disptimerRedeem.Stop(); this.txtStatus.Visibility = Visibility.Visible; } else { this.ClearAll(false); } MessageBox.ShowBox("MessageID377", BMC_Icon.Information); } } else { this.txtStatus.Text = Application.Current.FindResource("MessageID377").ToString(); txtAmount.Text = Convert.ToDecimal(objTicketDetail.TicketValue / 100).GetUniversalCurrencyFormat(); bisTicketExpired = false; this.txtStatus.Background = System.Windows.Media.Brushes.GreenYellow; } if (!Settings.IsGloryCDEnabled) { this.dispenserStatus.LoadItemsAysnc(); } }); if (!Settings.IsGloryCDEnabled) { _worker.Dispense("Voucher Number", objTicketDetail.TicketString, objTicketDetail.RedeemedAmount, act); } else { act(); disptimerRedeem.Start(); } } } if (objTicketDetail.EnableTickerPrintDetails) { this.gridRedeemedTicket.Visibility = Visibility.Visible; this.txtPrintedMachine.Text = objTicketDetail.RedeemedMachine; this.txtClaimedDevice.Text = objTicketDetail.RedeemedDevice; this.txtTickAmount.Text = objTicketDetail.RedeemedAmount.GetUniversalCurrencyFormatWithSymbol(); this.txtClaimedDate.Text = objTicketDetail.RedeemedDate.GetUniversalDateTimeFormat(); } else { this.gridRedeemedTicket.Visibility = Visibility.Hidden; } this.ucValueCalc.txtDisplay.Focus(); } } } else { MessageBox.ShowBox("MessageID105", BMC_Icon.Warning); this.ucValueCalc.txtDisplay.Focus(); } } catch (Exception ex) { BMC.Common.ExceptionManagement.ExceptionManager.Publish(ex); } finally { btnVerify.IsEnabled = true; } }
private void btnOK_Click(object sender, System.Windows.RoutedEventArgs e) { try { if (string.IsNullOrEmpty(txtOldPassword.Password)) { MessageBox.ShowBox("MessageID270", BMC_Icon.Warning); txtOldPassword.Focus(); return; } if (CryptoHelper.CreateHash(txtOldPassword.Password) != SecurityHelper.CurrentUser.Password) { MessageBox.ShowBox("MessageID271", BMC_Icon.Warning); txtOldPassword.Focus(); return; } if (string.IsNullOrEmpty(txtNewPassword.Password)) { MessageBox.ShowBox("MessageID272", BMC_Icon.Warning); txtOldPassword.Focus(); return; } if (txtNewPassword.Password.Length < 5) { MessageBox.ShowBox("MessageID273", BMC_Icon.Warning); txtNewPassword.Focus(); return; } if (string.IsNullOrEmpty(txtRetypePassword.Password)) { MessageBox.ShowBox("MessageID274", BMC_Icon.Warning); txtRetypePassword.Focus(); return; } //else if (txtRetypePassword.Password.Length < 5) //{ // MessageBox.ShowBox("Password length should be atleast 5 characters.", BMC_Icon.Warning, true); // txtRetypePassword.Focus(); // return; //} if (txtOldPassword.Password == txtNewPassword.Password) { MessageBox.ShowBox("MessageID276", BMC_Icon.Warning); txtNewPassword.Focus(); return; } if (txtOldPassword.Password == txtRetypePassword.Password) { MessageBox.ShowBox("MessageID276", BMC_Icon.Warning); txtRetypePassword.Focus(); return; } if (txtNewPassword.Password != txtRetypePassword.Password) { MessageBox.ShowBox("MessageID277", BMC_Icon.Warning); txtRetypePassword.Focus(); return; } if (!PasswordHelper.CheckPasswordStrength(txtNewPassword.Password)) { MessageBox.ShowBox("MessageID278", BMC_Icon.Warning); txtNewPassword.Password = ""; txtRetypePassword.Password = ""; txtNewPassword.Focus(); return; } try { _user.Password = txtNewPassword.Password; bChanged = _userManager.ChangePassword(_user); if (bChanged) { SecurityHelper.CurrentUser.Password = txtNewPassword.Password; userDataContext uDC = new userDataContext(oCommonUtilities.CreateInstance().GetConnectionString()); uDC.Export_History(_securityID.ToString(), "", "CHANGEPASSWORD", null); MessageBox.ShowBox("MessageID279", BMC_Icon.Information); txtOldPassword.Password = ""; txtNewPassword.Password = ""; txtRetypePassword.Password = ""; AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Password, Audit_Screen_Name = "ChangePassword", Audit_Desc = "Password changed by user.", AuditOperationType = OperationType.MODIFY }); this.DialogResult = true; this.Close(); } else { MessageBox.ShowBox("MessageID301", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Password, Audit_Screen_Name = "ChangePassword", Audit_Desc = "Unable to change password.", AuditOperationType = OperationType.MODIFY }); } } catch (Exception ex) { ExceptionManager.Publish(ex); MessageBox.ShowBox("MessageID301", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.Password, Audit_Screen_Name = "ChangePassword", Audit_Desc = "Unable to change password.", AuditOperationType = OperationType.MODIFY }); } } finally { btnOK.IsEnabled = true; } }
private void btnClear_Click(object sender, RoutedEventArgs e) { try { btnClear.IsEnabled = false; int retValue; if (int.Parse(cboRemedy.SelectedValue.ToString()) < 1) { MessageBox.ShowBox("MessageID143", BMC_Icon.Information); return; } if (txtNotes.Text == "") { MessageBox.ShowBox("MessageID144", BMC_Icon.Information); return; } if (MessageBox.ShowBox("MessageID145", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.Yes) { retValue = fieldService.CloseServiceCall(9999999, txtJobID.Text, int.Parse(cboRemedy.SelectedValue.ToString()), Security.SecurityHelper.CurrentUser.SecurityUserID, txtNotes.Text); if (retValue == 10) { MessageBox.ShowBox("MessageID146", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Cleared Service for " + txtJobID.Text, AuditOperationType = OperationType.MODIFY, Audit_Slot = Asset, Audit_Field = "JOB ID", Audit_New_Vl = txtJobID.Text }); this.Close(); } else if (retValue == 99) { MessageBox.ShowBox("MessageID147", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Service Call was not cleared.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); return; } else { MessageBox.ShowBox("MessageID148", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Failed while clearing a Service call.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } } } finally { btnClear.IsEnabled = true; } }