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;
                }
            }
        }