public EmailTemplateEdit(InvoiceRow invoiceRow) { InitializeComponent(); this.invoiceRow = invoiceRow; }
private void InsertRow(string sInvoiceID) { double fDays = double.Parse(m_cboDays.Text); fDays = fDays * -1; m_oInvoice.Get(sInvoiceID); string sExportToSSMS = m_oInvoice.GetCustomField("Export to SSMS"); string sSMSID = m_oInvoice.GetCustomField("SMSID"); string sJobID = m_oInvoice.GetCustomField("JobID"); DateTime invoiceExportDate = new DateTime(1950, 1, 1, 0, 0, 0, 0); DateTime fromDate = DateTime.Today.AddDays(fDays); DateTime toDate = DateTime.Today; if (DateTime.TryParse(sExportToSSMS, out invoiceExportDate)) { if (invoiceExportDate >= fromDate && invoiceExportDate <= toDate) { DateTime oTransactionDate = new DateTime(1950, 1, 1, 0, 0, 0, 0); DateTime.TryParse(m_oInvoice.TransactionDate, out oTransactionDate); int iInvoiceNumber = 0; int.TryParse(m_oInvoice.RefNumber, out iInvoiceNumber); double fAmount = 0; double.TryParse(m_oInvoice.BalanceRemaining, out fAmount); InvoiceRow oRow = new InvoiceRow(m_oInvoice.RefId, iInvoiceNumber, m_oInvoice.CustomerName, oTransactionDate, fAmount, sJobID, sSMSID); m_oRows.Add(oRow); } } }