//Get primary and secondary contacts public static List <BillingStatement> GetBillingStatementList(DateTime _StartDate, DateTime _EndDate, int _BillingGroup) { List <BillingStatement> listOfBillingStatements = new List <BillingStatement>(); BillingStatementDataContext dc = new BillingStatementDataContext(); var result = dc.S1_BillingStatement_GetBillingStatementList(_StartDate, _EndDate, _BillingGroup); foreach (var item in result) { BillingStatement tempBillingStatement = new BillingStatement(); tempBillingStatement.billingContact.ClientContactID = item.ClientContactID; tempBillingStatement.billingContact.ClientContactName = item.ContactName; tempBillingStatement.billingContact.BillingContactID = item.BillingContactID; tempBillingStatement.BillingContactName = item.ContactName; tempBillingStatement.ContactEmail = item.ContactEmail; tempBillingStatement.DeliveryMethod = item.DeliveryMethod; tempBillingStatement.ClientName = item.BillAsClientName; tempBillingStatement.LastPrinted = item.LastPrintedOn; tempBillingStatement.Amount = (item.Amount.HasValue ? item.Amount.Value : 0); tempBillingStatement.billingContact.ClientContactAddress1 = item.Amount.Value.ToString("F"); tempBillingStatement.CurrentActivity = (item.CurrentActivity == 1 ? "Yes" : (item.CurrentActivity == 2 ? "Audit" : (item.CurrentActivity == 3 ? "Secondary" : "No"))); //Only get primary contacts //if (item.PrimaryBillingContact.HasValue && item.PrimaryBillingContact.Value) listOfBillingStatements.Add(tempBillingStatement); } return(listOfBillingStatements); }
//Same as GetBillingStatementList, except that it is filtered by UserID public static List <BillingStatement> GetBillingStatementListFromUser(int _UserID, DateTime _StartDate, DateTime _EndDate) { List <BillingStatement> listOfBillingStatements = new List <BillingStatement>(); BillingStatementDataContext dc = new BillingStatementDataContext(); var result = dc.S1_BillingStatement_GetBillingStatementListFromUser(_UserID, _StartDate, _EndDate); foreach (var item in result) { BillingStatement tempBillingStatement = new BillingStatement(); tempBillingStatement.billingContact.ClientContactID = item.ClientContactID; tempBillingStatement.billingContact.BillingContactID = item.BillingContactID; tempBillingStatement.billingContact.DueText = item.StatementDate.Value.ToString("MM/dd/yyyy"); tempBillingStatement.billingContact.ClientContactName = item.ContactName; tempBillingStatement.billingContact.BillingContactName = item.ClientName; tempBillingStatement.billingContact.ClientContactAddress1 = item.Amount.Value.ToString("F"); listOfBillingStatements.Add(tempBillingStatement); } return(listOfBillingStatements); }
public static BillingStatement GetCurrentBillingStatement(int _BillingContactID, DateTime _StartDate, DateTime _EndDate) { BillingStatement billingStatement = new BillingStatement(_BillingContactID, _StartDate, _EndDate); return(billingStatement); }