public IOptionObject2015 Execute()
        {
            string message = "Error: There is no command matching the script name '" + _parameter.ScriptName + "'. Please verify your settings.";

            logger.Error(message);
            return(_optionObjectDecorator.ToReturnOptionObject(ErrorCode.Alert, message));
        }
        public IOptionObject2015 Execute()
        {
            double errorCode = 0;
            string errorMesg;

            try
            {
                int episodeCount = _repository.GetPatientCountOfOpenEpisodesByPatientId(_optionObject.Facility, _optionObject.EntityID);
                logger.Debug("The ODBC call successfully retrieved this value {value}.", episodeCount);
                errorMesg = "The ODBC call was successful.";
            }
            catch (OdbcException ex)
            {
                logger.Error(ex, "Could not connect to the ODBC Data Source. See ODBC Data log for more detail.");
                errorCode = 3;
                errorMesg = "Could not connect to the ODBC Data Source. See the ODBC Data log on the web server for more detail.";
            }
            catch (Exception ex)
            {
                logger.Error(ex, "An unexpected error occurred when attempting to get the ODBC data. See ODBC Data log for more detail.");
                throw;
            }

            return(_optionObject.ToReturnOptionObject(errorCode, errorMesg));
        }
Ejemplo n.º 3
0
        public IOptionObject2015 Execute()
        {
            string fieldNumber   = _parameter.Count() >= 2 ? _parameter.ToArray()[1] : "";
            string returnMessage = "The FieldValue is ";

            if (_optionObject.IsFieldPresent(fieldNumber))
            {
                returnMessage += _optionObject.GetFieldValue(fieldNumber);
            }

            returnMessage += ". Since no FieldObjects were modified, no Forms should be returned.";

            return(_optionObject.ToReturnOptionObject(ErrorCode.Informational, returnMessage));
        }
Ejemplo n.º 4
0
        public IOptionObject2015 Execute()
        {
            string fieldNumber = _parameter.Count() >= 2 ? _parameter.ToList()[1] : "";

            if (_optionObject.IsFieldPresent(fieldNumber))
            {
                string fieldValue = _optionObject.GetFieldValue(fieldNumber);
                if (string.IsNullOrEmpty(fieldValue))
                {
                    fieldValue = "I have set the FieldValue.";
                }
                else
                {
                    fieldValue += " (I have appended the FieldValue.)";
                }
                _optionObject.SetFieldValue(fieldNumber, fieldValue);
            }
            return(_optionObject.ToReturnOptionObject(ErrorCode.Success, "If FieldNumber '" + fieldNumber + "' is found in OptionObject, then it should be the only FieldObject returned. Otherwise, no Forms should be returned."));
        }
        public IOptionObject2015 Execute()
        {
            logger.Debug("Executing {command}.", nameof(SendEmailCommand));

            string      to          = "*****@*****.**";
            string      from        = "*****@*****.**";
            string      subject     = "Example Send Email Command";
            string      body        = @"This is our example email to demonstrate sending of emails from ScriptLink.";
            MailMessage mailMessage = new MailMessage(from, to)
            {
                IsBodyHtml = false,
                Subject    = subject,
                Body       = body
            };

            _smtpService.Send(mailMessage);
            _smtpService.Dispose();

            return(_optionObject.ToReturnOptionObject(ErrorCode.None, "Email sent."));
        }
Ejemplo n.º 6
0
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.OpenUrl, "https://rarelysimple.com"));
 }
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Success, "The code means the RunScript was successful."));
 }
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Warning, "The code means the RunScript is providing a warning requiring a response from the user."));
 }
Ejemplo n.º 9
0
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Alert, "No script was found with the name '" + _parameter.ScriptName + "'."));
 }
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Error, "The code means the RunScript experienced an Error and to stop processing."));
 }
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Confirm, "The code means the RunScript is prompting a confirmation."));
 }
 public IOptionObject2015 Execute()
 {
     logger.Debug("Executing HelloWorldCommand");
     return(_optionObject.ToReturnOptionObject(ErrorCode.Informational, "Hello, World!"));
 }
Ejemplo n.º 13
0
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.OpenForm, "[PM]USER100"));
 }
Ejemplo n.º 14
0
 public IOptionObject2015 Execute()
 {
     return(_optionObject.ToReturnOptionObject(ErrorCode.Informational, "The code means the RunScript was successful, however is providing an alert or informational notice."));
 }