public void TestGenerateICHEmail() { TVerificationResultCollection VerificationResults = new TVerificationResultCollection(); int PeriodNumber = 5; int ICHProcessingNumber = 1; int CurrencyType = 1; //base string FileName = TAppSettingsManager.GetValue("Server.PathTemp") + Path.DirectorySeparatorChar + "TestGenerateICHEmail.csv"; bool SendEmail = true; // make sure there is a valid email destination if (TGenFilesReports.GetICHEmailAddress(null).Length == 0) { string sqlStatement = String.Format("INSERT INTO PUB_{0}({1},{2},{3},{4}) VALUES (?,?,?,?)", AEmailDestinationTable.GetTableDBName(), AEmailDestinationTable.GetFileCodeDBName(), AEmailDestinationTable.GetConditionalValueDBName(), AEmailDestinationTable.GetPartnerKeyDBName(), AEmailDestinationTable.GetEmailAddressDBName()); OdbcParameter parameter; List <OdbcParameter> parameters = new List <OdbcParameter>(); parameter = new OdbcParameter("name", OdbcType.VarChar); parameter.Value = MFinanceConstants.EMAIL_FILE_CODE_STEWARDSHIP; parameters.Add(parameter); parameter = new OdbcParameter("condition", OdbcType.VarChar); parameter.Value = Convert.ToInt64(MFinanceConstants.ICH_COST_CENTRE) / 100; parameters.Add(parameter); parameter = new OdbcParameter("partnerkey", OdbcType.Int); parameter.Value = Convert.ToInt64(MFinanceConstants.ICH_COST_CENTRE) * 10000; parameters.Add(parameter); parameter = new OdbcParameter("email", OdbcType.VarChar); parameter.Value = TAppSettingsManager.GetValue("ClearingHouse.EmailAddress"); parameters.Add(parameter); bool SubmissionOK = true; TDBTransaction DBTransaction = null; DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref DBTransaction, ref SubmissionOK, delegate { DBAccess.GDBAccessObj.ExecuteNonQuery(sqlStatement, DBTransaction, parameters.ToArray()); DBAccess.GDBAccessObj.CommitTransaction(); }); } TGenFilesReports.GenerateStewardshipFile(FLedgerNumber, PeriodNumber, ICHProcessingNumber, CurrencyType, FileName, SendEmail, out VerificationResults); CommonNUnitFunctions.EnsureNullOrOnlyNonCriticalVerificationResults(VerificationResults, "Performing ICH Email File Generation Failed!"); }
public void TestGenerateStewardshipFile() { ImportAdminFees(); TVerificationResultCollection VerificationResults = new TVerificationResultCollection(); int PeriodNumber = 5; int ICHProcessingNumber = 1; int CurrencyType = 1; //base string FileName = TAppSettingsManager.GetValue("Server.PathTemp") + Path.DirectorySeparatorChar + "Test.csv"; bool SendEmail = false; TGenFilesReports.GenerateStewardshipFile(FLedgerNumber, PeriodNumber, ICHProcessingNumber, CurrencyType, FileName, SendEmail, out VerificationResults); CommonNUnitFunctions.EnsureNullOrOnlyNonCriticalVerificationResults(VerificationResults, "Performing Stewardship File Generation Failed!"); }