コード例 #1
0
        public EmailSender()
        {
            Collection<string> to = new Collection<string>();

            _template = new EmailTemplate(
                "New Coyote Moves Request",
                to,
                "*****@*****.**",
                "",
                "../../../CoyoteMoves/CoyoteMovesTemplate.pdf");

            _requester = new RequestFormDB();
        }
コード例 #2
0
        // POST api/RequestForm/SendChangeRequest
        public HttpResponseMessage SendChangeRequest(JObject json)
        {
            int managerID = GetIDFromName((string)json["current"]["bazookaInfo"]["managerId"]);
            int f_managerID = GetIDFromName((string)json["future"]["bazookaInfo"]["managerId"]);

            HttpResponseMessage useForFailure = new HttpResponseMessage(HttpStatusCode.NotFound);
            if ((managerID == -1) && (f_managerID == -1))
            {
                useForFailure.Content = new StringContent("Both current and future managers were not found.");
                return useForFailure;
            }
            else if (managerID == -1)
            {
                useForFailure.Content = new StringContent("Current manager was not found.");
                return useForFailure;
            }
            else if (f_managerID == -1)
            {
                useForFailure.Content = new StringContent("Future manager was not found.");
                return useForFailure;
            }

            RequestForm obj = makeRequestForm(json);

            Collection<string> to = new Collection<string>();
            to.Add("*****@*****.**");
            EmailSender emailer = new EmailSender("Coyote Moves Request ", to, "*****@*****.**", "", HttpContext.Current.Server.MapPath("/CoyoteMoves/CoyoteMovesTemplate.pdf"));
            emailer.sendMovesRequest(obj);

            RequestFormDB formDB = new RequestFormDB();
            formDB.StoreRequestFormInDatabaseAsPending(obj);

            return new HttpResponseMessage(HttpStatusCode.OK);
        }
コード例 #3
0
 public AnalyticsDB()
 {
     _requester = new RequestFormDB();
     _dataRequest = new RequestDataDB();
     _connectionString = (string)System.Web.Configuration.WebConfigurationManager.ConnectionStrings["DataClientRead"].ConnectionString;
 }
コード例 #4
0
 public EmailSender(string subject, Collection<string> to, string from, string emailBody, string pdfLocation)
 {
     _template = new EmailTemplate(subject, to, from, emailBody, pdfLocation);
     _requester = new RequestFormDB();
 }
コード例 #5
0
 public AnalyticsDB()
 {
     _requester        = new RequestFormDB();
     _dataRequest      = new RequestDataDB();
     _connectionString = (string)System.Web.Configuration.WebConfigurationManager.ConnectionStrings["DataClientRead"].ConnectionString;
 }
コード例 #6
0
 public void setup()
 {
     _requester = new RequestFormDB();
     _req = new RequestForm(301757);
     TestStoreRequestFormInDatabaseAsPending();
 }