protected void btnProcessFile_Click(object sender, EventArgs e) { txtResults.Visible = true; if (RecurringGateway == Gateway.ro_GWPAYFLOWPRO) { btnProcessFile.Enabled = false; } DateTime dtRun = LastImportDate; if (dtRun == System.DateTime.MinValue) { dtRun = DateTime.Today.AddDays(-1); // Defaults to yesterday } if (dtRun >= DateTime.Today && (RecurringGateway == Gateway.ro_GWPAYFLOWPRO)) { txtInputFile.Text = AppLogic.GetString("admin.recurringimport.NothingToProcess", SkinID, LocaleSetting); btnGetGatewayStatus.Enabled = false; return; } if (txtInputFile.Text.Length == 0) { txtResults.Text = AppLogic.GetString("admin.recurringimport.NothingToProcessForget", SkinID, LocaleSetting); } else { RecurringOrderMgr rmgr = new RecurringOrderMgr(); String sResults = String.Empty; String Status = rmgr.ProcessAutoBillStatusFile(RecurringGateway, txtInputFile.Text, out sResults); if (Status == AppLogic.ro_OK) { txtResults.Text = sResults; } else { txtResults.Text = Status; } } btnGetGatewayStatus.Enabled = true; AppConfigManager.SetAppConfigValue("Recurring.GatewayLastImportedDate", Localization.ToDBDateTimeString(DateTime.Now)); LastRunPanel.Visible = true; lblLastRun.Text = String.Format(AppLogic.GetString("admin.recurringimport.LastImport", SkinID, LocaleSetting), Localization.ToThreadCultureShortDateString(dtRun)); LastImportDate = dtRun; }
protected String ProcessData(String StatusXML) { String result = String.Empty; DateTime dtRun = dtLastRun; if (dtRun == System.DateTime.MinValue) { dtRun = DateTime.Today.AddDays((double)-1); // Defaults to yesterday } else { if (m_GW == Gateway.ro_GWVERISIGN || m_GW == Gateway.ro_GWPAYFLOWPRO) { dtRun = DateTime.Today.AddDays((double)-1); // Always runs through yesterday } else { dtRun = dtLastRun.AddDays((double)1.0); // other gateways default to one day period } } if (StatusXML.Length == 0 || !StatusXML.Contains("<TX ")) { result = "Nothing to process... No new data."; } else { RecurringOrderMgr rmgr = new RecurringOrderMgr(AppLogic.MakeEntityHelpers(), null); String sResults = String.Empty; String Status = rmgr.ProcessAutoBillStatusFile(m_GW, StatusXML, out sResults); if (Status == AppLogic.ro_OK) { result = sResults; } else { result = Status; } } AppLogic.SetAppConfig("Recurring.GatewayLastImportedDate", Localization.ToDBDateTimeString(dtRun)); return(result); }
protected void btnProcessFile_Click(object sender, EventArgs e) { txtResults.Visible = true; if (m_GW == Gateway.ro_GWVERISIGN || m_GW == Gateway.ro_GWPAYFLOWPRO) { btnProcessFile.Enabled = false; } dtLastRun = Localization.ParseDBDateTime(AppLogic.AppConfig("Recurring.GatewayLastImportedDate")); DateTime dtRun = dtLastRun; if (dtRun == System.DateTime.MinValue) { dtRun = DateTime.Today.AddDays((double)-1); // Defaults to yesterday } else { if (m_GW == Gateway.ro_GWVERISIGN || m_GW == Gateway.ro_GWPAYFLOWPRO) { dtRun = DateTime.Today.AddDays((double)-1); // Always runs through yesterday } else { dtRun = DateTime.Today.AddDays((double)-1); // Flag for yesterday } } if (dtRun >= DateTime.Today && (m_GW == Gateway.ro_GWVERISIGN || m_GW == Gateway.ro_GWPAYFLOWPRO)) { txtInputFile.Text = AppLogic.GetString("admin.recurringimport.NothingToProcess", SkinID, LocaleSetting); btnGetGatewayStatus.Enabled = false; return; } if (txtInputFile.Text.Length == 0) { txtResults.Text = AppLogic.GetString("admin.recurringimport.NothingToProcessForget", SkinID, LocaleSetting); } else { RecurringOrderMgr rmgr = new RecurringOrderMgr(AppLogic.MakeEntityHelpers(), null); String sResults = String.Empty; String Status = rmgr.ProcessAutoBillStatusFile(m_GW, txtInputFile.Text, out sResults); if (Status == AppLogic.ro_OK) { txtResults.Text = sResults; } else { txtResults.Text = Status; } } btnGetGatewayStatus.Enabled = true; AppLogic.SetAppConfig("Recurring.GatewayLastImportedDate", Localization.ToDBDateTimeString(dtRun)); lblLastRun.Text = String.Format(AppLogic.GetString("admin.recurringimport.LastImport", SkinID, LocaleSetting), Localization.ToThreadCultureShortDateString(dtRun)); dtLastRun = dtRun; }