internal async void ScanDeliveredOD(string orderid, string orderedID) { Boolean status = false; if (orderid == orderedID) { var patientid = MealDeliveredCollection.FirstOrDefault(x => x.OrderedID.ToString() == orderid); var mealtime_id = SelectedMealTime.ID; HttpClient httpClient = new System.Net.Http.HttpClient(); DateTime dt = SelectedDate; string format_date = dt.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/" + Library.METHODE_QRVERIFIED + "/" + patientid.pateint_id + "/" + orderid + "/" + mealtime_id + "/" + format_date); //HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, URL + "/" + Library.METHODE_QRVERIFIED + "/" + patientid + "/" + tagid + "/" + mealtime_id + "/" + format_date); HttpResponseMessage response = await httpClient.SendAsync(request); // jarray= await response.Content.ReadAsStringAsync(); //dynamic data = JsonConvert.DeserializeObject<dynamic>(await response.Content.ReadAsStringAsync()); var data = await response.Content.ReadAsStringAsync(); var list = JsonConvert.DeserializeObject <List <Scan_verify> >(data); if (list.Count > 0) { status = list[0].is_verifed; } //status = Convert.ToBoolean(data.is_verifed); //status = data.is_verifed; //JArray jarray = JArray.Parse(data); if (status) { await GetMealDeliveredData(); } } else { await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("scanned_orderid_not_match", AppResources.Culture), "OK"); } }
private async void UpdateOrder() { bool ischecked = false; if (IsCareGiver) { if (MealDeliveredCollection.Where(x => x.is_checked).Count() == 0) { await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("yc", CultureInfo.CurrentCulture), "OK"); return; } if (MealDeliveredCollection.Where(x => x.is_checked).Count() > 1) { await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("yc", CultureInfo.CurrentCulture), "OK"); return; } SelectedOrderDetail = MealDeliveredCollection.FirstOrDefault(x => x.is_checked); SelectedOrderDetail.ward_bed = SelectedOrderDetail.Ward + "-" + SelectedOrderDetail.Bed; // displaying patient information on caregiver popup if (IsCareGiver) { await GetCaregiverData(); var ui = new CaregiverODPopup(caregiver_details.FirstOrDefault(), this); ui.BindingContext = SelectedOrderDetail; await _iNavigation.PushPopupAsync(ui, false); } else { await PageDialog.DisplayAlertAsync("Alert", "Please select record first.", "Ok"); } } else { for (int i = 0; i < MealDeliveredCollection.Count; i++) { mstr_mealdelivered mealdelivered = MealDeliveredCollection.ElementAt(i); if (mealdelivered.is_checked) { ischecked = true; break; } } if (ischecked) { await SendDelivered_request(); if (success) { await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("delivered_message", AppResources.Culture), "OK"); } await GetMealDeliveredData(); //await PageDialog.DisplayAlertAsync("Alert!!", AppResources.ResourceManager.GetString("delivered_message", CultureInfo.CurrentCulture), "OK"); //await DisplayAlert(AppResources.ResourceManager.GetString("alert", CultureInfo.CurrentCulture), AppResources.ResourceManager.GetString("delivered_message", CultureInfo.CurrentCulture), "OK"); } else { await PageDialog.DisplayAlertAsync("Alert", "Please select record first.", "Ok"); } //} } }