Beispiel #1
0
 private void BTN_subscribe_Click(object sender, RoutedEventArgs e)
 {
     request request = new request();
     UserAt usr = new UserAt();
     usr.first_name = TB_fn.Text;
     usr.last_name = TB_ln.Text;
     usr.email = TB_mail.Text;
     if (TB_Pass.Text == TB_VPass.Text){
         usr.password = TB_Pass.Text;
         usr.password_confirmation = TB_VPass.Text;
         string Sjson = JsonConvert.SerializeObject(new { user = usr });
         string user = request.Post("http://api.linkat.fr/api/users", "", Sjson, "");
         if (user == "")
         {
             MessageDialog msg;
             msg = new MessageDialog("An error as come, please try later.");
             msg.ShowAsync();
             //this.Frame.Navigate(typeof(Subscribe));
         }
         else
         {
             this.Frame.Navigate(typeof(Login));
         }
     } else {
         MessageDialog msg;
         msg = new MessageDialog("Sorry, your password doesn't match");
         msg.ShowAsync();
     }
 }
Beispiel #2
0
 private void create_medicalbook_Click(object sender, RoutedEventArgs e)
 {
     MessageDialog msg;
     request request1 = new request();
     string book = request1.Get("http://api.linkat.fr/api/medical_book_by_user_id", "?user_id=" + usr.id.ToString(), usr.auth_token);
     if (book == "")
     {
         string json = JsonConvert.SerializeObject(new { medical_book = new { user_id = usr.id.ToString(), size = "", weight = "", agreement = true } });         
         //msg = new MessageDialog(json);
         //msg.ShowAsync();
         request request = new request();
         string ret = request.Post("http://api.linkat.fr/api/medical_book/", "", json, usr.auth_token);
         msg = new MessageDialog("Carnet médical créer. Cliquer sur \"Voir\" pour consulter et modifier le carnet médical");
         msg.ShowAsync();
     }
     else
     {
         msg = new MessageDialog("Votre carnet médical a déjà été créé. Cliquer sur \"Voir\" pour le consulter et le modifier");
         msg.ShowAsync();
     }
 }