public void PrintSlip(jackpotProcessInfoDTO jackpot) { JackpotXml xml = null; try { filename = "Print.txt"; filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; if (File.Exists(filepath)) { File.Delete(filepath); } outputfile = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write); writer = new StreamWriter(outputfile); writer.BaseStream.Seek(0, SeekOrigin.End); xml = new JackpotXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; string screenName = Settings.CAGE_ENABLED ? "PrintCageSlip|" : ""; switch (jackpot.jackpotTypeId) { case 1: Type = "AttendantPay Credit"; screenName += "AttendantPay Credit"; break; case 2: Type = "AttendantPay Jackpot"; screenName += "AttendantPay Jackpot"; break; case 3: Type = "Progressive"; screenName += "Progressive"; break; case 4: Type = "MANUAL CREDIT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL CREDIT"; break; case 5: Type = "MANUAL JACKPOT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL JACKPOT"; break; case 6: Type = "MANUAL PROGRESSIVE"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL PROGRESSIVE"; break; default: Type = "Handpay"; screenName += "Handpay"; break; } // Modified by A.Vinod Kumar at 3:40 PM 17/01/12 // required values for xml string sVersion = CommonDataAccess.GetVersion(); double JAmt = Double.Parse(jackpot.hpjpAmount.ToString()) / 100; double jActualAmt = JAmt; if (JAmt < 0) { jActualAmt = (-1 * JAmt); } string JAmtInWords = objWords.ConvertValueToWords(jActualAmt, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values xml[JackpotXmlFields.SiteName].Value = jackpot.siteNo; // Site Name xml[JackpotXmlFields.BMCVersion].Value = sVersion; // BMC Version xml[JackpotXmlFields.Type].Value = Type; // Type xml[JackpotXmlFields.Amount].Value = CommonUtilities.GetCurrency(JAmt); // Amount xml[JackpotXmlFields.AmountInWords].Value = JAmtInWords; // Amount in Words xml[JackpotXmlFields.TransactionDateTime].Value = jackpot.TransactionDate; // Transaction Date/Time xml[JackpotXmlFields.BarPosition].Value = jackpot.assetConfigNumber + "/" + jackpot.Slot; // Bar Position xml[JackpotXmlFields.SlotDenom].Value = jackpot.Denom.ToString(); // Slot Denomination xml[JackpotXmlFields.SiteID].Value = jackpot.siteId.ToString(); // Site Id xml[JackpotXmlFields.PrintedDate].Value = DateTime.Now.GetUniversalDateTimeFormat(); // Printed Date/Time xml[JackpotXmlFields.SequenceNo].Value = jackpot.sequenceNumber.ToString(); // Sequence No xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = module, Audit_Screen_Name = screenName, Audit_Desc = Type, AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = xml[JackpotXmlFields.Amount].Value.ToString(), Audit_Slot = xml[JackpotXmlFields.BarPosition].Value }); } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (xml != null) { xml.Dispose(); xml = null; } } }
public void PrintSlip(jackpotProcessInfoDTO jackpot) { JackpotXml xml = null; try { filename = "Print.txt"; filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; if (File.Exists(filepath)) { File.Delete(filepath); } outputfile = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write); writer = new StreamWriter(outputfile); writer.BaseStream.Seek(0, SeekOrigin.End); xml = new JackpotXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; string screenName = Settings.CAGE_ENABLED ? "PrintCageSlip|" : ""; switch (jackpot.jackpotTypeId) { case 1: Type = "AttendantPay Credit"; screenName += "AttendantPay Credit"; break; case 2: Type = "AttendantPay Jackpot"; screenName += "AttendantPay Jackpot"; break; case 3: Type = "Progressive"; screenName += "Progressive"; break; case 4: Type = "MANUAL CREDIT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL CREDIT"; break; case 5: Type = "MANUAL JACKPOT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL JACKPOT"; break; case 6: Type = "MANUAL PROGRESSIVE"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL PROGRESSIVE"; break; default: Type = "Handpay"; screenName += "Handpay"; break; } // Modified by A.Vinod Kumar at 3:40 PM 17/01/12 // required values for xml string sVersion = CommonDataAccess.GetVersion(); double JAmt = Double.Parse(jackpot.hpjpAmount.ToString()) / 100; double jActualAmt = JAmt; if (JAmt < 0) jActualAmt = (-1 * JAmt); string JAmtInWords = objWords.ConvertValueToWords(jActualAmt, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values xml[JackpotXmlFields.SiteName].Value = jackpot.siteNo; // Site Name xml[JackpotXmlFields.BMCVersion].Value = sVersion; // BMC Version xml[JackpotXmlFields.Type].Value = Type; // Type xml[JackpotXmlFields.Amount].Value = CommonUtilities.GetCurrency(JAmt); // Amount xml[JackpotXmlFields.AmountInWords].Value = JAmtInWords; // Amount in Words xml[JackpotXmlFields.TransactionDateTime].Value = jackpot.TransactionDate; // Transaction Date/Time xml[JackpotXmlFields.BarPosition].Value = jackpot.assetConfigNumber + "/" + jackpot.Slot; // Bar Position xml[JackpotXmlFields.SlotDenom].Value = jackpot.Denom.ToString(); // Slot Denomination xml[JackpotXmlFields.SiteID].Value = jackpot.siteId.ToString(); // Site Id xml[JackpotXmlFields.PrintedDate].Value = DateTime.Now.GetUniversalDateTimeFormat(); // Printed Date/Time xml[JackpotXmlFields.SequenceNo].Value = jackpot.sequenceNumber.ToString(); // Sequence No xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = module, Audit_Screen_Name = screenName, Audit_Desc = Type, AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = xml[JackpotXmlFields.Amount].Value.ToString(), Audit_Slot = xml[JackpotXmlFields.BarPosition].Value }); } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (xml != null) { xml.Dispose(); xml = null; } } }