Beispiel #1
0
        /// <summary>
        /// Gets the command line arguments for the reporting process for a given report date.
        /// </summary>
        /// <param name="reportDate">The date of the report to be generated.</param>
        /// <param name="emailReport">Flag that determines if report should be e-mailed, if enabled.</param>
        public string GetArguments(DateTime reportDate, bool emailReport)
        {
            const string CryptoKey = "0679d9ae-aca5-4702-a3f5-604415096987";

            string arguments = string.Format(
                "{0} " +
                "--reportDate=\" {1:yyyy-MM-dd} \"",
                GetArguments(),
                reportDate);

            if (emailReport && EnableReportEmail)
            {
                arguments = string.Format(
                    "{0} " +
                    "--smtpServer=\" {1} \" " +
                    "--fromAddress=\" {2} \" " +
                    "--toAddresses=\" {3} \" " +
                    "--username=\" {4} \" " +
                    "--password=\" {5} \"",
                    arguments,
                    SmtpServer,
                    FromAddress,
                    ToAddresses,
                    SmtpUsername,
                    SmtpPassword.Encrypt(CryptoKey, CipherStrength.Aes256));
            }

            return(arguments);
        }