From a3a28aa1b4f8958cd1674a9a41e5d4169974e981 Mon Sep 17 00:00:00 2001 From: RDeck Date: Tue, 11 Nov 2025 05:51:06 -0500 Subject: [PATCH] ! --- ClassObj/ClsDobbsEmail_T1439.cs | 15 +++++++-------- ClassObj/ServiceMain.cs | 2 +- kmCustomReportsNET.csproj | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ClassObj/ClsDobbsEmail_T1439.cs b/ClassObj/ClsDobbsEmail_T1439.cs index 3895992..442d30f 100644 --- a/ClassObj/ClsDobbsEmail_T1439.cs +++ b/ClassObj/ClsDobbsEmail_T1439.cs @@ -54,8 +54,8 @@ internal class ClsDobbsEmail_T1439 : IDisposable { bool? ReportDueNow = false; - ReportDueNow = DebugMode || cn.ExecuteScalar("Select Top 1 [NeedToSend] From [crpt].[Dobbs_EmailContestCalendar] Where [SendReport]=@Today", new { Today = DateTime.Today }); - if (ReportDueNow.HasValue && ReportDueNow.Value) + ReportDueNow = DebugMode || cn.ExecuteScalar("[crpt].[Dobbs_T1439_EmailContests]", new { ExecMode = 1 }, commandType: CommandType.StoredProcedure); + if (ReportDueNow.HasValue && ReportDueNow.Value == true) { cn.Open(); @@ -64,6 +64,7 @@ internal class ClsDobbsEmail_T1439 : IDisposable using (var da = new SqlDataAdapter(cm)) { //cm.Parameters.Add("@DateThruOverride", SqlDbType.Date).Value = DateTime.Parse("Oct 7, 2025"); // override the date thru date for testing + //cm.Parameters.Add("@ExecMode", SqlDbType.Int).Value = 0; ds = new DataSet(); da.Fill(ds); } @@ -80,7 +81,8 @@ internal class ClsDobbsEmail_T1439 : IDisposable appLog.DebugFormat("{0} report is now sending out the email containing the report for this week.", ReportID.ToString()); SendEmails(); - cn.Execute("Update [crpt].[Dobbs_EmailContestCalendar] Set [NeedToSend]=0 Where [SendReport]=@Today", new { Today = DateTime.Today }); + //cn.Execute("Update [crpt].[Dobbs_EmailContestCalendar] Set [NeedToSend]=0 Where [SendReport]=@Today", new { Today = DateTime.Today }); + cn.Execute("[crpt].[Dobbs_T1439_EmailContests]", new { ExecMode = 2 }, commandType: CommandType.StoredProcedure); } } @@ -106,18 +108,15 @@ internal class ClsDobbsEmail_T1439 : IDisposable { DataRow drDates = ds.Tables[0].Rows[0]; string xlsFilename; - int ctr = 0; SubjectToUse = string.Format("Email Capture Contest - Week {0} ({1:MMM d}-{2:MMM d}) Results", drDates["WeekNumber"], drDates["wkFrom"], drDates["wkTo"]); xlsFilename = Path.Combine(RptSaveToFolder, string.Format("Dobbs {0:yyyy-MM MMM} Week {1} Email Contest Results.xlsx", drDates["mthTo"], drDates["WeekNumber"])); if (File.Exists(xlsFilename)) { + int ctr = 0; string f0 = xlsFilename; while (File.Exists(f0)) - { - f0 = Path.Combine(RptSaveToFolder, string.Format("Dobbs {0:yyyy-MM MMM} Week {1} Email Contest Results - OLD{2:000}.xlsx", drDates["mthTo"], drDates["WeekNumber"], ctr)); - ctr += 1; - } + f0 = Path.Combine(RptSaveToFolder, string.Format("Dobbs {0:yyyy-MM MMM} Week {1} Email Contest Results - OLD{2:000}.xlsx", drDates["mthTo"], drDates["WeekNumber"], ctr++)); File.Move(xlsFilename, f0); } diff --git a/ClassObj/ServiceMain.cs b/ClassObj/ServiceMain.cs index 8d92ee0..8311e35 100644 --- a/ClassObj/ServiceMain.cs +++ b/ClassObj/ServiceMain.cs @@ -21,7 +21,7 @@ internal class ServiceMain : ServiceControl { AssemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; } - catch + catch { AssemblyVersion = new Version("1.0"); } diff --git a/kmCustomReportsNET.csproj b/kmCustomReportsNET.csproj index 316d57e..09fd1c9 100644 --- a/kmCustomReportsNET.csproj +++ b/kmCustomReportsNET.csproj @@ -5,9 +5,9 @@ net9.0-windows enable enable - 1.3.0.5 - 1.3.0.5 - 1.3.0.5 + 1.3.0.11 + 1.3.0.11 + 1.3.0.11