public HttpResponseMessage CompletedJury(JuryModel model) { ItemResponse <Boolean> response = new ItemResponse <Boolean>(); response.Item = JuryList.Completed(model.JuryId); return(Request.CreateResponse(response)); }
public async System.Threading.Tasks.Task <HttpResponseMessage> Completion(JuryModel model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } await MessagingService.CompletionMail(model); return(Request.CreateResponse()); }
public static JuryModel GetJuror(int id) { JuryModel model = new JuryModel(); for (int i = 0; i < _list.Count(); i++) { if (id == _list[i].JuryId) { return(_list[i]); } } return(model); }
public static async Task CompletionMail(JuryModel model) //****guide { SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo(model.Email); myMessage.From = new MailAddress(_siteAdminEmailAddress, "The Honor System"); myMessage.Subject = "Confirm Email"; string path = HttpContext.Current.Server.MapPath("~/Template/CompletionEmail.html"); string contents = File.ReadAllText(path); myMessage.Html = contents; await SendAsync(myMessage); }