public EmailSender() { Collection<string> to = new Collection<string>(); _template = new EmailTemplate( "New Coyote Moves Request", to, "*****@*****.**", "", "../../../CoyoteMoves/CoyoteMovesTemplate.pdf"); _requester = new RequestFormDB(); }
// 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); }
public AnalyticsDB() { _requester = new RequestFormDB(); _dataRequest = new RequestDataDB(); _connectionString = (string)System.Web.Configuration.WebConfigurationManager.ConnectionStrings["DataClientRead"].ConnectionString; }
public EmailSender(string subject, Collection<string> to, string from, string emailBody, string pdfLocation) { _template = new EmailTemplate(subject, to, from, emailBody, pdfLocation); _requester = new RequestFormDB(); }
public void setup() { _requester = new RequestFormDB(); _req = new RequestForm(301757); TestStoreRequestFormInDatabaseAsPending(); }