/// <summary> /// Initializes a new instance of the <see cref="JackpotXmlField"/> class. /// </summary> /// <param name="textSettings">The text settings.</param> /// <param name="name">The name.</param> public JackpotXmlField(TextSettings textSettings, string name) { _textSettings = textSettings; this.XmlName = name; this.NameWidthPercentage = 0.36f; this.ValueWidthPercentage = 0.64f; }
/// <summary> /// Populates the printer settings. /// </summary> private void PopulatePrinterSettings() { PageSettings pageSettings = null; try { PrintDocument doc = new PrintDocument(); PrinterSettings prnSettings = doc.PrinterSettings; if (prnSettings != null) { pageSettings = prnSettings.DefaultPageSettings; } if (pageSettings == null) { pageSettings = doc.DefaultPageSettings; } } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (pageSettings == null) { LogManager.WriteLog("^^^^=> (PopulatePrinterSettings) : Unable to get the page settings.", LogManager.enumLogLevel.Info); } _textSettings = new TextSettings(pageSettings); } }
private void PrintSlippage(TextSettings textSettings) { string filename = "Print.txt"; printDocument1 = new PrintDocument(); printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage); filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; fileToPrint = new System.IO.StreamReader(filepath); printFont = textSettings.TextFont; printDocument1.DocumentName = filepath; printDocument1.Print(); fileToPrint.Close(); }
private void PrintSlippage(TextSettings textSettings) #endif { string filename = "Print.txt"; printDocument1 = new PrintDocument(); printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage); filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; fileToPrint = new System.IO.StreamReader(filepath); #if SP5_SLIP_FORMAT printFont = new System.Drawing.Font("Courier New", 10, FontStyle.Bold); #else printFont = textSettings.TextFont; #endif printDocument1.DocumentName = filepath; printDocument1.Print(); fileToPrint.Close(); }
public void PrintSlip(DataRow drFillDetails, string strFillType) { ValuetoWords objWords = new ValuetoWords(); VaultSlipXml 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 VaultSlipXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; // Header=0, //PrintedDate, //SiteName, //Vault_Name, //SerialNo, //Manufacturer, //Type, //Fill_User, //FillDate, //Initial_Balance, //Fill_Amount, //CurrentBalance, //Signature // required values for xml string sVersion = CommonDataAccess.GetVersion(); Double dAmount = Double.Parse(drFillDetails["FillAmount"].ToString()); if (dAmount < 0) { dAmount = dAmount * -1; } string AmtInWords = objWords.ConvertValueToWords(dAmount, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values //xml[VaultSlipXmlFields.Header].Value = "Fill slip"; xml[VaultSlipXmlFields.PrintedDate].Value = DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.SiteName].Value = Settings.SiteName; xml[VaultSlipXmlFields.Vault_Name].Value = drFillDetails["Name"].ToString(); xml[VaultSlipXmlFields.SerialNo].Value = drFillDetails["Serial_NO"].ToString(); xml[VaultSlipXmlFields.Manufacturer].Value = drFillDetails["Manufacturer_Name"].ToString(); xml[VaultSlipXmlFields.Type].Value = drFillDetails["Type_Prefix"].ToString(); xml[VaultSlipXmlFields.Fill_User].Value = SecurityHelper.CurrentUser.DisplayName; xml[VaultSlipXmlFields.FillDate].Value = DateTime.Parse(drFillDetails["CreatedDate"].ToString()).ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.Fill_Amount].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["FillAmount"].ToString())); if (strFillType != string.Empty) { xml[VaultSlipXmlFields.Fill_Type].Value = strFillType; } xml[VaultSlipXmlFields.Initial_Balance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["TotalAmountOnFill"].ToString())); xml[VaultSlipXmlFields.CurrentBalance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["CurrentBalance"].ToString())); xml[VaultSlipXmlFields.Signature].Value = string.Empty; xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (xml != null) { xml.Dispose(); xml = null; } } }
public void PrintSlip(DataRow drFillDetails,string strFillType) { ValuetoWords objWords = new ValuetoWords(); VaultSlipXml 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 VaultSlipXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; // Header=0, //PrintedDate, //SiteName, //Vault_Name, //SerialNo, //Manufacturer, //Type, //Fill_User, //FillDate, //Initial_Balance, //Fill_Amount, //CurrentBalance, //Signature // required values for xml string sVersion = CommonDataAccess.GetVersion(); Double dAmount =Double.Parse(drFillDetails["FillAmount"].ToString()); if (dAmount < 0) dAmount = dAmount * -1; string AmtInWords = objWords.ConvertValueToWords(dAmount, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values //xml[VaultSlipXmlFields.Header].Value = "Fill slip"; xml[VaultSlipXmlFields.PrintedDate].Value = DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.SiteName].Value = Settings.SiteName; xml[VaultSlipXmlFields.Vault_Name].Value = drFillDetails["Name"].ToString(); xml[VaultSlipXmlFields.SerialNo].Value = drFillDetails["Serial_NO"].ToString(); xml[VaultSlipXmlFields.Manufacturer].Value = drFillDetails["Manufacturer_Name"].ToString(); xml[VaultSlipXmlFields.Type].Value = drFillDetails["Type_Prefix"].ToString(); xml[VaultSlipXmlFields.Fill_User].Value =SecurityHelper.CurrentUser.DisplayName; xml[VaultSlipXmlFields.FillDate].Value = DateTime.Parse(drFillDetails["CreatedDate"].ToString()).ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.Fill_Amount].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["FillAmount"].ToString())); if(strFillType!=string.Empty) xml[VaultSlipXmlFields.Fill_Type].Value = strFillType; xml[VaultSlipXmlFields.Initial_Balance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["TotalAmountOnFill"].ToString())); xml[VaultSlipXmlFields.CurrentBalance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["CurrentBalance"].ToString())); xml[VaultSlipXmlFields.Signature].Value = string.Empty; xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); } 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; } } }
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; } } }