protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int cid = Convert.ToInt32(Session["CID"]); c = getselectedcomplain(cid); COMPLAINTYPES ct = getcomplaintype(c.ComplainTypeId); EMPLOYEE emp = getEmployee(c.EmployeeId); String ctype = ct.ComplainType; ComplainTypeValue.Text = ctype; String ename = getEmployeeName(emp); EmployeeNameValue.Text = ename; ComplainDescriptionValue.Text = c.ComplainDescription; StatusValue.SelectedValue = c.ComplainStatus; FeedbackValue.Text = c.feedbackDescription; } }
private COMPLAINTYPES getcomplaintype(int complainTypeId) { using (var client = new HttpClient()) { client.BaseAddress = new Uri(Global.URIstring); //HTTP GET var responseTask = client.GetAsync("ComplainType/" + complainTypeId); responseTask.Wait(); var result = responseTask.Result; if (result.IsSuccessStatusCode) { var readTask = result.Content.ReadAsAsync <COMPLAINTYPES>(); readTask.Wait(); COMPLAINTYPES ct = readTask.Result; return(ct); } else { return(null); } } }