示例#1
0
        private bool requiresTP(String service)
        {
            bool retVal = false;

            log.Debug("SDJL: serviceChosen: Service '" + service + "'");
            log.Debug("SDJL: serviceConfiguration'" + TxPlanHardStopConfig.GetTxPlanHardStopConfig().ToString() + "'");
            log.Debug("SDJL: serviceConfiguration.RequiresTreatmentPlan'" + TxPlanHardStopConfig.GetTxPlanHardStopConfig().RequiresTreatmentPlan + "'");
            log.Debug("SDJL: RequiresTreatmentPlan.Contains('" + service + "') returnValue= '" + TxPlanHardStopConfig.GetTxPlanHardStopConfig().RequiresTreatmentPlan.Contains(service) + "'");
            if (TxPlanHardStopConfig.GetTxPlanHardStopConfig().RequiresTreatmentPlan.Contains(service))
            {
                retVal = true;
            }
            log.Debug("SDJL: END TxPlanHardStop requiresTP RETVAL = '" + retVal + "'");
            return(retVal);
        }
示例#2
0
 private static void init()
 {
     // NOTE - DATA DRIVE THIS - PUT INTO A TABLE AND USE A SELECT TO
     //        RETRIEVE THESE VALUES
     // Read Configuration
     using (FileStream fs = File.OpenRead("C:\\inetpub\\wwwroot\\TxPlanHardStop\\TxPlanHardStopService.json"))
     {
         using (StreamReader configStreamReader = new StreamReader(fs))
         {
             string configStr = configStreamReader.ReadToEnd();
             log.Debug("SDJL: configStr = '" + configStr + "'");
             instance = JsonConvert.DeserializeObject <TxPlanHardStopConfig>(configStr);
             log.Debug("SDJL - RequiresTreatmentPlan = " + TxPlanHardStopConfig.GetTxPlanHardStopConfig().RequiresTreatmentPlan);
             log.Debug("Config = " + TxPlanHardStopConfig.GetTxPlanHardStopConfig());
             log.Debug("Config.RequiresHardStop = " + TxPlanHardStopConfig.GetTxPlanHardStopConfig().RequiresTreatmentPlan);
             log.Debug("Config.mailList = '" + TxPlanHardStopConfig.GetTxPlanHardStopConfig().mailList + "'");
         }
     }
 }
示例#3
0
        private void sendNotificationToMailingList(OptionObject2015 hardStopToReturn)
        {
            // Data drive configuration
            try
            {
                MailMessage mail       = new MailMessage("*****@*****.**", TxPlanHardStopConfig.GetTxPlanHardStopConfig().mailList);
                SmtpClient  SmtpServer = new SmtpClient("10.20.20.214");

                mail.Subject = "HARD STOP: " + System.DateTime.Now.ToString("MM/dd/yyyy h:mm");
                mail.Body    = "A hard stop occurred at " + System.DateTime.Now.ToString("MM/dd/yyyy h:mm") + " for client: " + client + ".  ";
                mail.Body   += "\n  Terri, this an contain whatever you like.\n";
                mail.Body   += "Value:  " + hardStopToReturn.ErrorMesg;

                SmtpServer.Port        = 25;
                SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "3edcVFR$3edc");

                SmtpServer.Send(mail);
                log.Debug("SDJL: Mail Sent at: " + DateTime.Now.ToString("MM/dd/yyyy h:mm"));
            }
            catch (Exception e)
            {
                log.Debug("SDJL Send Email Exception: " + e.ToString());
            }
        }
示例#4
0
 public static void SetTxPlanHardStopConfig(TxPlanHardStopConfig config)
 {
     instance = config;
 }