public void BindGrid() { ItemGridView.ItemsSource = null; HttpClient client = new HttpClient(); client.BaseAddress = new Uri(app.DomainName); StringBuilder strb = new StringBuilder(); strb.Append("auth_token=" + app.AccessToken); strb.Append("&acquirer_id=" + app.UserId); strb.Append("&site=" + app.Site); strb.Append("&user_name=" + app.Username); HttpResponseMessage response = client.GetAsync( "/rest/case/reviewedReports?" + strb.ToString()).Result; PatientREST patientrest; List<PatientREST> pinfo = new List<PatientREST>(); var temp=""; if (response.IsSuccessStatusCode) { dynamic users = JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result); foreach (dynamic item in users) { patientrest = new PatientREST(); foreach (dynamic i in item) { if (i.Name == "id") patientrest.id = Convert.ToString(i.Value.Value); if (i.Name == "patient_file_id") patientrest.patient_file_id = Convert.ToString(i.Value.Value); if (i.Name == "") patientrest.patient_name = i.Value.Value; if (i.Name == "") patientrest.image_left_url = i.Value.Value; if (i.Name == "imageRightUrl") { //patientrest.image_right_url = "ms-appdata:///roaming/Upload/" + i.Value.Value; //Source="ms-appdata:///roaming/upload/acq1_1.jpg" var items = i.Value.Value; string[] temparray = items.ToString().Split('/'); // patientrest.image_right_url = "ms-appdata:///roaming/Upload/"+temparray[4]; if (app.UserRole == "acquirer") patientrest.image_right_url = "ms-appdata:///roaming/Upload/" + temparray[4]; if (app.UserRole == "expert") patientrest.image_right_url = "ms-appdata:///roaming/Download/" + temparray[4]; patientrest.FileName = temparray[4]; } if (i.Name == "") patientrest.acquirer_user_id = i.Value.Value; if (i.Name == "") patientrest.auth_token = i.Value.Value; if (i.Name == "") patientrest.site = i.Value.Value; if (i.Name == "") patientrest.workflow_status = i.Value.Value; if (i.Name == "sex") patientrest.sex = i.Value.Value; if (i.Name == "age") patientrest.age = i.Value.Value; if (i.Name == "dateOfBirth") patientrest.dob = i.Value.Value; if (i.Name == "aflag") patientrest.aflag = i.Value.Value; if (i.Name == "bflag") patientrest.bflag = i.Value.Value; if (i.Name == "cflag") patientrest.cflag = i.Value.Value; if (i.Name == "dflag") patientrest.dflag = i.Value.Value; if (i.Name == "acomment") patientrest.acomment = i.Value.Value; if (i.Name == "bcomment") patientrest.bcomment = i.Value.Value; if (i.Name == "ccomment") patientrest.ccomment = i.Value.Value; if (i.Name == "dcomment") patientrest.dcomment = i.Value.Value; if (i.Name == "") patientrest.userId = Convert.ToString(i.Value.Value); if (i.Name == "createdAt") patientrest.CreatedOn = Convert.ToString(i.Value.Value); if (i.Name == "reviewed_date") patientrest.ReviewedDate = Convert.ToString(i.Value.Value); } pinfo.Add(patientrest); } } ItemGridView.ItemsSource = pinfo; }
private void Grid_Tapped_1(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { //this.Frame.Navigate(typeof(ItemSubPage)); var model = (PatientREST)((FrameworkElement)sender).DataContext; selecteditem = model; this.Frame.Navigate(typeof(AcReport)); }