private Dictionary <string, string> GetTokenValueDictionary_UserActionNeededReminder(DateTime dteDate) { OrderAddressStatHelper objOrderAddressStatHelper = new OrderAddressStatHelper(); if (objOrderAddressStatHelper.LoadAllOrderAddresss()) { List <OrderAddress> lstOrderAddressesErroring; List <OrderAddress> lstOrderAddressesAbandoned; // Append the number of Addresses ADDED string strNumberOfAddressesErroring = String.Empty; if (objOrderAddressStatHelper.GetNumberOfOrderAddressesErroring(out lstOrderAddressesErroring)) { strNumberOfAddressesErroring = lstOrderAddressesErroring.Count.ToString(); } else { strNumberOfAddressesErroring = "(Could not be calculated at this time)"; } string strNumberOfAddressesAbandoned = String.Empty; if (objOrderAddressStatHelper.GetNumberOfOrderAddressesAbandoned(out lstOrderAddressesAbandoned)) { strNumberOfAddressesAbandoned = lstOrderAddressesErroring.Count.ToString(); } else { strNumberOfAddressesAbandoned = "(Could not be calculated at this time)"; } string strTableMarkup = String.Empty; string strNumberOfPaymentsNeedingAttention; List <OrderAddress> lstOrderAddressesNeedingAttention = new List <OrderAddress>(); lstOrderAddressesNeedingAttention.AddRange(lstOrderAddressesErroring); lstOrderAddressesNeedingAttention.AddRange(lstOrderAddressesAbandoned); strNumberOfPaymentsNeedingAttention = lstOrderAddressesAbandoned.Count().ToString(); strTableMarkup = GetOrderAddressTableRowsMarkup(lstOrderAddressesNeedingAttention); string strGreeting = GetRandomGreeting(); Dictionary <string, string> dctTemplateValuesToReplace = new Dictionary <string, string>(); dctTemplateValuesToReplace.Add("{Greeting}", strGreeting); dctTemplateValuesToReplace.Add("{Date}", dteDate.ToString("f")); dctTemplateValuesToReplace.Add("{NumberAddressesErrored}", strNumberOfAddressesErroring); dctTemplateValuesToReplace.Add("{NumberAddressesAbandoned}", strNumberOfPaymentsNeedingAttention); dctTemplateValuesToReplace.Add("<!--{OrderAddressTableRows}-->", strTableMarkup); return(dctTemplateValuesToReplace); } return(null); }
private Dictionary <string, string> GetTokenValueDictionary_Stats(DateTime dteDate) { OrderAddressStatHelper objOrderAddressStatHelper = new OrderAddressStatHelper(); // Append the number of addresses ADDED int intNumberOfNewAddressesCreated = 0; string strNumberOfNewAddresses = String.Empty; if (objOrderAddressStatHelper.LoadAllOrderAddresss()) { if (objOrderAddressStatHelper.GetNumberOfOrderAddresssAddedOrModifiedOnSpecificDay(dteDate, RecordTimeStampType.Added, out intNumberOfNewAddressesCreated)) { strNumberOfNewAddresses = intNumberOfNewAddressesCreated.ToString(); } else { strNumberOfNewAddresses = "(Could not be calculated at this time)"; } // Total Number of Addresses int intTotalNumAddresses = 0; string strNumberOfTotalAddresses = String.Empty; if (objOrderAddressStatHelper.GetTotalNumberOfOrderAddresssInSystem(out intTotalNumAddresses)) { strNumberOfTotalAddresses = intTotalNumAddresses.ToString(); } else { strNumberOfTotalAddresses = "(Could not be calculated at this time)"; } List <Model.StatValuePair> lstStatValuePair; string strTableMarkup = String.Empty; if (objOrderAddressStatHelper.GetOrderAddressCountsGroupedByStatus(out lstStatValuePair)) { strTableMarkup = GetTableRowsMarkup(lstStatValuePair); } else { strTableMarkup = "(Could not be calculated at this time)"; } List <Model.StatValuePair> lstStatValuePair_Country; string strTableMarkup_Currency = String.Empty; if (objOrderAddressStatHelper.GetOrderAddressValueGroupedByCountry(out lstStatValuePair_Country)) { strTableMarkup_Currency = GetTableRowsMarkup(lstStatValuePair_Country); } else { strTableMarkup_Currency = "(Could not be calculated at this time)"; } // Total Number of Addresses int intSuccessfulATIFileTransCount = 0; string strNumberOfSuccessfullyProcessed = String.Empty; if (objOrderAddressStatHelper.GetSuccessfullyProcessedCount(out intSuccessfulATIFileTransCount)) { strNumberOfSuccessfullyProcessed = intSuccessfulATIFileTransCount.ToString(); } else { strNumberOfSuccessfullyProcessed = "(Could not be calculated at this time)"; } string strGreeting = GetRandomGreeting(); Dictionary <string, string> dctTemplateValuesToReplace = new Dictionary <string, string>(); dctTemplateValuesToReplace.Add("{Greeting}", strGreeting); dctTemplateValuesToReplace.Add("{Date}", dteDate.ToString("D")); dctTemplateValuesToReplace.Add("{NumberAddressesAdded}", strNumberOfNewAddresses); dctTemplateValuesToReplace.Add("{NumberTotalAddresses}", strNumberOfTotalAddresses); dctTemplateValuesToReplace.Add("{NumberOfSuccessfullyProcessed}", strNumberOfSuccessfullyProcessed); dctTemplateValuesToReplace.Add("<!--{StatusTableRows}-->", strTableMarkup); dctTemplateValuesToReplace.Add("<!--{CountryTableRows}-->", strTableMarkup_Currency); return(dctTemplateValuesToReplace); } return(null); }