private void InitializeHistoricalInforamtion(ProductType productType, bool IsForDayEnd) { _currentTime = (IsForDayEnd == true && productType == ProductType.PostPaid) ? _currentTime.AddDays(1) : _currentTime; if (productType == ProductType.Prepaid) { _prepaidHistoricalInfo = new HistoricalInfo(); _prepaidHistoricalInfo.LastRunDate = _currentTime.ToString("dd-MMM-yyyy"); _prepaidHistoricalInfo.LastFileSerialNo = 0; _prepaidHistoricalInfo.LastTransSerialNo = 1; _prepaidHistoricalInfo.ProductType = ProductType.Prepaid.ToString(); } else { _postpaidHistoricalInfo = new HistoricalInfo(); _postpaidHistoricalInfo.LastRunDate = _currentTime.ToString("dd-MMM-yyyy"); _postpaidHistoricalInfo.LastFileSerialNo = 0; _postpaidHistoricalInfo.LastTransSerialNo = 1; _postpaidHistoricalInfo.ProductType = ProductType.PostPaid.ToString(); } }
private void GetHistoricalInformation() { try { List <HistoricalInfo> listOfhistoricalInfo = _xmlHandler.ReadXml <HistoricalInfo>(_historicalInfoPathLoc); foreach (HistoricalInfo historicalInfo in listOfhistoricalInfo) { if (historicalInfo.LastRunDate != DateTime.Now.Date.ToString("dd-MMM-yyyy")) { historicalInfo.LastFileSerialNo = 0; historicalInfo.LastTransSerialNo = 1; historicalInfo.LastRunDate = DateTime.Now.Date.ToString("dd-MMM-yyyy"); } if (historicalInfo.ProductType.ToString() == ProductType.Prepaid.ToString()) { _prepaidHistoricalInfo = historicalInfo; } else { _postpaidHistoricalInfo = historicalInfo; } } } catch (Exception exception) { EventLog.WriteEntry(sSource, "GetHistoricalInformation Not Found...", EventLogEntryType.Error); } if (_prepaidHistoricalInfo == null) { InitializeHistoricalInforamtion(ProductType.Prepaid, false); } if (_postpaidHistoricalInfo == null) { InitializeHistoricalInforamtion(ProductType.PostPaid, false); } }