Exemplo n.º 1
0
        public ActionResult getParentResponses(ParentEntry parentinfo)
        {
            Parent parent = new Parent
            {
                FirstName          = parentinfo.firstName,
                LastName           = parentinfo.lastname,
                PhoneNumber        = parentinfo.phonenumber,
                Email              = parentinfo.email,
                NumberOfStudents   = parentinfo.numberofstudents,
                StudentGradesArray = parentinfo.studentgradesarray,
                PaymentPreference  = parentinfo.paymentpreference,
                Date = parentinfo.date
            };

            try
            {
                ParentClient tableStorage = new ParentClient();
                tableStorage.Add(parent);
                return(Content("ok"));
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound, ex.Message));
            }
        }
 public override void Track(ITelemetry telemetry)
 {
     //initialize the telemetry based on the context of this client and then push it to
     //the next immediate ancestor to complete processing.
     this.Initialize(telemetry);
     ParentClient.Track(telemetry);
 }
Exemplo n.º 3
0
 public ActionResult DeleteParents()
 {
     try
     {
         ParentClient tableStorage = new ParentClient();
         tableStorage.DeleteTable();
         return(Content(JsonConvert.SerializeObject(new { }), "application/json"));
     }
     catch (Exception ex)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.NotFound, ex.Message));
     }
 }
Exemplo n.º 4
0
 public ActionResult DeleteParents()
 {
     try
     {
         ParentClient tableStorage = new ParentClient();
         tableStorage.DeleteTable();
         return(Content("ok"));
     }
     catch (Exception ex)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.NotFound, ex.Message));
     }
 }
Exemplo n.º 5
0
 public ActionResult getParentResponses(Parent pParent)
 {
     try
     {
         ParentClient tableStorage = new ParentClient();
         tableStorage.Add(pParent);
         string emailTemplate = EmailTemplateHelper.GetTemplate("ParentEmail");
         string emailBody     = string.Format(emailTemplate, pParent.FirstName);
         EmailHelper.SendEmail(pParent.Email, "*****@*****.**", "Your Registration Follow up", emailBody, true);
         return(Content(JsonConvert.SerializeObject(new { }), "application/json"));
     }
     catch (Exception ex)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.NotFound, ex.Message));
     }
 }