public GetInstIDandRules(StudentClass s) { InitializeComponent(); chsubbtn.IsEnabled = false; chsubbtn.BackgroundColor = Color.DarkGray; student = s; }
public async Task getstudnetinfo() { cvboxf.BackgroundColor = Color.FromHex(onColor); cvboxs.BackgroundColor = Color.FromHex(offColor); cvboxt.BackgroundColor = Color.FromHex(offColor); cvboxfo.BackgroundColor = Color.FromHex(offColor); string url = "https://api.shikkhanobish.com/api/Master/GetInfoByStudentID"; HttpClient client = new HttpClient(); string jsonData = JsonConvert.SerializeObject(new { StudentID = parentinfo.StudentID });// T.D: have to add student ID StringContent content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(url, content).ConfigureAwait(true); var result = await response.Content.ReadAsStringAsync().ConfigureAwait(true); student = JsonConvert.DeserializeObject <StudentClass> (result); await callInfo(); List <ParentsCardInfo> Pci = new List <ParentsCardInfo> (); ParentsCardInfo pci1 = new ParentsCardInfo(); ParentsCardInfo pci2 = new ParentsCardInfo(); ParentsCardInfo pci3 = new ParentsCardInfo(); ParentsCardInfo pci4 = new ParentsCardInfo(); pci1.ImageSource = "rechargeins.jpg"; pci1.Text = "Recharge Instruction"; pci1.info = "Send money to 01753202936 and use reference code: " + student.StudentID; pci1.TextColors = "#FF000000"; pci1.fontSize = 13; Pci.Add(pci1); pci2.ImageSource = "savedmoney.jpg"; pci2.Text = "Account Balence"; pci2.info = "" + student.RechargedAmount + " Taka"; pci2.TextColors = "#FFFFFFFF"; pci2.fontSize = 18; Pci.Add(pci2); pci3.ImageSource = "spentmoney.jpg"; pci3.Text = "Total Spent"; pci3.info = totalSpent + " Taka"; pci3.fontSize = 18; pci3.TextColors = "#FFFFFFFF"; Pci.Add(pci3); pci4.ImageSource = "topsubject.jpg"; pci4.Text = "Favourite Subject"; pci4.info = topsub; pci4.TextColors = "#FF000000"; pci4.fontSize = 18; Pci.Add(pci4); cv.ItemsSource = Pci; cv.CurrentItemChanged += OnCurrentItemChanged; }
public async void backtoProfile() { StudentClass student = new StudentClass(); string url = "https://api.shikkhanobish.com/api/Master/GetInfoByLogin"; HttpClient client = new HttpClient(); string jsonData = JsonConvert.SerializeObject(new { UserName = info.Student.UserName, Password = info.Student.Password }); StringContent content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(url, content).ConfigureAwait(false); string result = await response.Content.ReadAsStringAsync(); student = JsonConvert.DeserializeObject <StudentClass>(result); OldStToNewSt chng = new OldStToNewSt(); var countPagesToRemove = Application.Current.MainPage.Navigation.ModalStack.Count; Device.BeginInvokeOnMainThread(async( ) => { await Application.Current.MainPage.Navigation.PushModalAsync(new StudentProfile(chng.Sc_TO_S(student))).ConfigureAwait(false); }); }