//despers all offered courses of this session and department void offer_crs_of_session(string session, string id) { student_detail = student_detal(id); offer_crs_list = crs_db.Offerd_course_table.ToList(); foreach (var iteam in offer_crs_list) { if (iteam.Session == session && student_detail.student_program == iteam.Courses_Table.degree_programs.degree_title_) { offer_crs_list_of_session.Add(iteam); } } }
public IHttpActionResult GetStudent_detail(string id) { student_detail = student_detal(id); if (student_detail == null) { return(NotFound()); } else { return(Ok(student_detail)); } }
private void getstudentdetail(string id) { HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:2665/"); // Add an Accept header for JSON format. client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // List all Names. HttpResponseMessage response = client.GetAsync("api/Student_detail/" + id).Result; // Blocking call! if (response.IsSuccessStatusCode) { var products = response.Content.ReadAsStringAsync().Result; Studentdetail stu_detail = JsonConvert.DeserializeObject <Studentdetail>(products); Student_name.Text = stu_detail.student_name; Student_Departmnt.Text = stu_detail.student_departmnt; Student_program.Text = stu_detail.student_program; } }