Example #1
0
        private async void ViewMarks_Button_Clicked(object sender, EventArgs e)
        {
            List <MarksClass> lnac = new List <MarksClass>();

            try
            {
                var client = new HttpClient();
                client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
                var uri    = $"https://api.medmee.in/Marks/DisplayResult?SID={Application.Current.Properties["UID"]}&ResultType={ExamType_Picker.SelectedItem}";
                var result = await client.GetStringAsync(uri);

                var JSON_DATA = JsonConvert.DeserializeObject <List <MarksClass> >(result);
                var COUNT     = JSON_DATA.Count;

                for (int i = 0; i < COUNT; i++)
                {
                    MarksClass mr = new MarksClass()
                    {
                        SUBJECT      = JSON_DATA[i].SUBJECT,
                        MARKS_OBTAIN = JSON_DATA[i].MARKS_OBTAIN,
                        MARKS_OUTOF  = JSON_DATA[i].MARKS_OUTOF,
                        STATUS       = JSON_DATA[i].STATUS,
                    };
                    lnac.Add(mr);
                }

                Marks_List.ItemsSource = lnac;
            }
            catch (Exception ee)
            {
                await DisplayAlert("Message", "No Data To Show", "Ok");
            }
        }
Example #2
0
        public IActionResult ProcessData(string ListOfMarks)
        {
            var obj = new MarksClass();

            if (ListOfMarks != null)
            {
                var arr = ListOfMarks.Split(",").Select(x => Convert.ToInt32(x)).ToList();

                Sorter.QuickSort(arr, 0, arr.Count - 1);
                obj.markslist = arr;

                return(View("MarksOfNStudents", obj));
            }
            else
            {
                return(View("MarksOfNStudents"));
            }
        }