private void SaveDetails_EventsFromConnexus(bool IsVoid) { string strTreasuryType = string.Empty; float fTreasuryAmount = 0.00F; try { Treasury objHandpayEntity = new Treasury(); IHandpay objCashDeskOperator = HandpayBusinessObject.CreateInstance(); DataRowView objHandpays = null; if (lvUnprocessedHandpays.SelectedItem != null) { objHandpays = (DataRowView)lvUnprocessedHandpays.SelectedItem; strTreasuryType = objHandpays.Row["Type"].ToString(); if (strTreasuryType.ToUpper() == "HANDPAY") { strTreasuryType = TREASURY_HANDPAY_CREDIT;; } else if (strTreasuryType.ToUpper() == "JACKPOT") { strTreasuryType = TREASURY_HANDPAY_JACKPOT; } else if (strTreasuryType.ToUpper() == "PROG") { strTreasuryType = TREASURY_PROG; } objHandpayEntity.TreasuryType = strTreasuryType; objHandpayEntity.CollectionNumber = 0; objHandpayEntity.InstallationNumber = int.Parse(objHandpays.Row["Installation_No"].ToString()); objHandpayEntity.UserID = BMC.Common.clsSecurity.UserID; objHandpayEntity.TreasuryReason = ""; objHandpayEntity.TreasuryReasonCode = 0; objHandpayEntity.TreasuryAllocated = 0; objHandpayEntity.TreasuryBreakdown100p = 0; objHandpayEntity.TreasuryBreakdown10p = 0; objHandpayEntity.TreasuryBreakdown200p = 0; objHandpayEntity.TreasuryBreakdown20p = 0; objHandpayEntity.TreasuryBreakdown2p = 0; objHandpayEntity.TreasuryBreakdown50p = 0; objHandpayEntity.TreasuryBreakdown5p = 0; objHandpayEntity.TreasuryIssuerUserNo = BMC.Common.clsSecurity.UserID; objHandpayEntity.TreasuryMembershipNo = "0"; objHandpayEntity.TreasuryAmount = float.Parse(objHandpays.Row["Amount"].ToString()); fTreasuryAmount = objHandpayEntity.TreasuryAmount; iTreasuryID = objCashDeskOperator.ProcessHandPay(objHandpayEntity); string strTEID = string.Empty; strTEID = objHandpays.Row["TE_Id"].ToString(); if (objCashDeskOperator.UpdateTicketException(strTEID) == false) { BMC.Common.LogManagement.LogManager.WriteLog("Error while updating ticket exception table", BMC.Common.LogManagement.LogManager.enumLogLevel.Info); } if (IsVoid == true) { fTreasuryAmount = -fTreasuryAmount; } //MachineDetails.TreasuryNo = iTreasuryID.ToString(); //MachineDetails.Value = objHandpayEntity.TreasuryAmount.ToString(); if (strTreasuryType == TREASURY_HANDPAY_CREDIT) { strTreasuryType = "Handpay"; } (oCommonUtilities.CreateInstance()).PrintCommonReceipt(strTreasuryType); objCashDeskOperator.ClearHandpayLock(int.Parse(objHandpays.Row["Installation_No"].ToString())); if (IsVoid == false) { MessageBox.showBox("Data is now saved", BMC_Icon.Information); } txtSelectedValue.Text = string.Empty; FillHandpays(); } } 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 SaveManualHandpay() { string strTreasuryType = string.Empty; try { Treasury objHandpayEntity = new Treasury(); if (optHandpay.IsChecked == true) { strTreasuryType = TREASURY_HANDPAY_CREDIT;; } else if (optJackpot.IsChecked == true) { strTreasuryType = TREASURY_HANDPAY_JACKPOT; } else { strTreasuryType = TREASURY_PROG; } objHandpayEntity.TreasuryType = strTreasuryType; DataRowView rowview = (DataRowView)lvMachines.SelectedItem; objHandpayEntity.InstallationNumber = int.Parse(rowview.Row[3].ToString()); objHandpayEntity.UserID = BMC.Common.clsSecurity.UserID; objHandpayEntity.TreasuryReason = ""; objHandpayEntity.TreasuryReasonCode = 0; objHandpayEntity.TreasuryAllocated = 0; objHandpayEntity.TreasuryBreakdown100p = 0; objHandpayEntity.TreasuryBreakdown10p = 0; objHandpayEntity.TreasuryBreakdown200p = 0; objHandpayEntity.TreasuryBreakdown20p = 0; objHandpayEntity.TreasuryBreakdown2p = 0; objHandpayEntity.TreasuryBreakdown50p = 0; objHandpayEntity.TreasuryBreakdown5p = 0; objHandpayEntity.TreasuryIssuerUserNo = BMC.Common.clsSecurity.UserID; objHandpayEntity.TreasuryMembershipNo = "0"; if (txtBox != null) { objHandpayEntity.TreasuryAmount = float.Parse(txtBox.Text); } IHandpay objCashDeskOperator = HandpayBusinessObject.CreateInstance(); int iTreasuryID = objCashDeskOperator.ProcessHandPay(objHandpayEntity); if (iTreasuryID != 0) { MessageBox.showBox("This Data is now saved", BMC_Icon.Information); //MachineDetails.TreasuryNo = iTreasuryID.ToString(); //MachineDetails.Value = objHandpayEntity.TreasuryAmount.ToString(); if (strTreasuryType == TREASURY_HANDPAY_CREDIT) { strTreasuryType = "Handpay"; } (oCommonUtilities.CreateInstance()).PrintCommonReceipt(strTreasuryType); txtBox.Text = "0.00"; } else { return; } } catch (Exception ex) { ExceptionManager.Publish(ex); } }
void EXClas_ACK(ComExchangeLib.MessageAck MessageAck) { if (MessageAck.ACK) { bool IsVoid = false; string strTEID = string.Empty; string strTreasuryType = string.Empty; //float fTreasuryAmount = 0.00F; double fTreasuryAmount; try { Treasury objHandpayEntity = new Treasury(); IHandpay objCashDeskOperator = HandpayBusinessObject.CreateInstance(); strTreasuryType = TREASURY_HANDPAY_CREDIT; //Get the type of treasury event if (_POSDetail.HandPayType == "HandPay") { strTreasuryType = TREASURY_HANDPAY_CREDIT;; } else if (_POSDetail.HandPayType == "Jackpot") { strTreasuryType = TREASURY_HANDPAY_JACKPOT; } else if (_POSDetail.HandPayType == "Progressive") { strTreasuryType = TREASURY_PROG; } //Save the treasury details in treasury table. objHandpayEntity.TreasuryType = strTreasuryType; objHandpayEntity.CollectionNumber = 0; objHandpayEntity.InstallationNumber = _POSDetail.InstallationNo; objHandpayEntity.UserID = Security.SecurityHelper.CurrentUser.SecurityUserID; objHandpayEntity.TreasuryReason = ""; objHandpayEntity.TreasuryReasonCode = 0; objHandpayEntity.TreasuryAllocated = 0; objHandpayEntity.TreasuryBreakdown100p = 0; objHandpayEntity.TreasuryBreakdown10p = 0; objHandpayEntity.TreasuryBreakdown200p = 0; objHandpayEntity.TreasuryBreakdown20p = 0; objHandpayEntity.TreasuryBreakdown2p = 0; objHandpayEntity.TreasuryBreakdown50p = 0; objHandpayEntity.TreasuryBreakdown5p = 0; objHandpayEntity.TreasuryIssuerUserNo = Security.SecurityHelper.CurrentUser.SecurityUserID; objHandpayEntity.TreasuryMembershipNo = "0"; objHandpayEntity.TreasuryAmount = double.Parse(_POSDetail.HandPayValue.ToString()); fTreasuryAmount = objHandpayEntity.TreasuryAmount; iTreasuryID = objCashDeskOperator.ProcessHandPay(objHandpayEntity); DataTable dt = new DataTable(); dt = analysisBusinessObject.GetTicketException(_POSDetail.InstallationNo); foreach (DataRow dr in dt.Rows) { strTEID = BMC.Presentation.Helper_classes.Common.GetRowValue <int>(dr, "TE_ID").ToString(); break; } if (objCashDeskOperator.UpdateTicketException(strTEID) == false) { BMC.Common.LogManagement.LogManager.WriteLog("Error while updating ticket exception table", BMC.Common.LogManagement.LogManager.enumLogLevel.Info); } //Create a receipt with -ve amount incase of a void transaction if (IsVoid == true) { fTreasuryAmount = -fTreasuryAmount; } //Print the receipt for handpay. //MachineDetails.TreasuryNo = iTreasuryID.ToString(); //MachineDetails.Value = objHandpayEntity.TreasuryAmount.ToString(); if (strTreasuryType == TREASURY_HANDPAY_CREDIT) { strTreasuryType = "Handpay"; } (oCommonUtilities.CreateInstance()).PrintCommonReceipt(false, strTreasuryType, ""); if (IsVoid == false) { MessageBox.ShowBox("MessageID57", BMC_Icon.Information); } this.Visibility = Visibility.Hidden; } catch (Exception ex) { MessageBox.ShowBox("MessageID59", BMC_Icon.Error); ExceptionManager.Publish(ex); } } else { MessageBox.ShowBox("MessageID59", BMC_Icon.Error); } }