private async void Button_Clicked(object sender, EventArgs e) { if (ms.isSent == true) { if (codeEntry.Text == vrNumber.ToString()) { if (ts == 0) { string url = "https://api.shikkhanobish.com/api/Master/RegisterStudent"; HttpClient client = new HttpClient(); string jsonData = JsonConvert.SerializeObject(new { UserName = studentm.UserName, Password = studentm.Password, PhoneNumber = studentm.PhoneNumber, Name = studentm.Name, Age = studentm.Age, Class = studentm.Class, InstitutionName = studentm.InstitutionName, RechargedAmount = 0, IsPending = 0, TotalTuitionTime = 0, TotalTeacherCount = 0, AvarageRating = 0, }); StringContent content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(url, content).ConfigureAwait(true); string result = await response.Content.ReadAsStringAsync().ConfigureAwait(true); Response responseData = JsonConvert.DeserializeObject <Response>(result); LoginByUserNameAndPassword(); } else if (ts == 1) { OldStToNewSt chng = new OldStToNewSt(); await Application.Current.MainPage.Navigation.PushModalAsync(new GetInstIDandRules( chng.S_TO_Sc(studentm))).ConfigureAwait(false); } } else { Msglbl.Text = "Code doesn't match! Try again."; //92746 } } else if (codeEntry.Text == null) { Msglbl.Text = "Enter the code"; } }
private async void Button_Clicked_1(object sender, EventArgs e) { if (ts == 0) { await Application.Current.MainPage.Navigation.PushModalAsync(new StudentProfile ( studentm )).ConfigureAwait(false); } if (ts == 1) { OldStToNewSt chng = new OldStToNewSt(); await Application.Current.MainPage.Navigation.PushModalAsync(new GetInstIDandRules ( chng.S_TO_Sc(studentm))).ConfigureAwait(false); } }