public voucherDTO createVoucher(voucherDTO ticketFormDTO) { if (!CheckCageEnabled()) { return(null); } //string strValue = request.amount; long lValue = 0; try { //if (strValue != null && strValue != string.Empty) // //lValue = Convert.ToInt64(Convert.ToSingle(strValue, new CultureInfo(CurrentCurrenyCulture)) * 100); lValue = ticketFormDTO.amount; //else // lValue = 0; //if (lValue <= 0) //{ // MessageBox.ShowBox("MessageID101"); // return; //} if (!string.IsNullOrEmpty(Settings.IssueTicketMaxValue)) { long lSettingValue = Convert.ToInt64(Settings.IssueTicketMaxValue.GetSingleFromString() * 100); if (lValue > lSettingValue) { // string sMessage = Application.Current.FindResource("MessageID247") as string; //MessageBox.ShowBox(sMessage + ": " + // ExtensionMethods.GetUniversalCurrencyFormat(Convert.ToInt64(Settings.IssueTicketMaxValue.GetSingleFromString())), // BMC_Icon.Error, true); //return; } } if ((lValue <= 99999999) && (lValue > 0)) { issueTicketEntity.lnglValue = lValue; issueTicketEntity.Type = "1"; issueTicketEntity.dblValue = ticketFormDTO.amount; issueTicketEntity.lnglValue = ticketFormDTO.amount * 100; issueTicketEntity.Date = DateTime.Today; BMC.Transport.voucherDTO oVoucherDTO = objCashDeskOperator.IssueTicketToCage(issueTicketEntity, ticketFormDTO); } else { //MessageBox.ShowBox("MessageID104", BMC_Icon.Warning); //return; } } catch (Exception ex) { ExceptionManager.Publish(ex); } return(ticketFormDTO); }
public createBulkVoucherResponse createBulkVoucher(createBulkVoucherRequest createBulkVoucher) { if (!CheckCageEnabled()) { return(null); } this.SetUser(createBulkVoucher.createBulkVoucher.arg0.employeeId); createBulkVoucherResponse oResponse = new createBulkVoucherResponse(); voucherDTO ticketFormDTO = createBulkVoucher.createBulkVoucher.arg0; int noOfTickets = createBulkVoucher.createBulkVoucher.arg1; long lValue = 0; try { lValue = ticketFormDTO.amount; oResponse.createBulkVoucherResponse1 = new voucherDTO[noOfTickets]; for (int i = 0; i < noOfTickets; i++) { issueTicketEntity.lnglValue = lValue; issueTicketEntity.Type = "1"; issueTicketEntity.lnglValue = ticketFormDTO.amount; issueTicketEntity.dblValue = ticketFormDTO.amount; issueTicketEntity.Date = DateTime.Today; BMC.Transport.voucherDTO oVoucherDTCopy = ticketFormDTO.Clone(); if (!string.IsNullOrEmpty(Settings.IssueTicketMaxValue)) { long lSettingValue = Convert.ToInt64(Settings.IssueTicketMaxValue.GetSingleFromString() * 100); if (lValue > lSettingValue || (lValue < 0)) { oVoucherDTCopy.errorCodeId = -1001; } else { oVoucherDTCopy = objCashDeskOperator.IssueTicketToCage(issueTicketEntity, oVoucherDTCopy); } } else { oVoucherDTCopy = objCashDeskOperator.IssueTicketToCage(issueTicketEntity, oVoucherDTCopy); } oResponse.createBulkVoucherResponse1[i] = oVoucherDTCopy; } } catch (Exception ex) { ExceptionManager.Publish(ex); } return(oResponse); }