public async Task <ObservableCollectionView <EscalationAndStatusThread> > QueryAllEscalationAndStatusThread(ProductWithSelectedItem AllMyPlatform, EscalationStatusWithSelectedItem EscalatonStatusList, string startDatestring, string endDatestring) { ObservableCollectionView <EscalationAndStatusThread> EscalationThreadList = new ObservableCollectionView <EscalationAndStatusThread>(); HttpClient HttpClient = new HttpClient(); Product MyProduct = new Product(); MyProduct = AllMyPlatform.SelectedItem; string plaform = MyProduct.Platform; EscalationStatus MyEscalationStatus = new EscalationStatus(); MyEscalationStatus = EscalatonStatusList.SelectedItem; string status = MyEscalationStatus.Status; var HttpResponseMessage = await HttpClient.GetAsync(new Uri(string.Format("http://escalationmanagerwebapi.azurewebsites.net/api/ethreads?etime1={0}&etime2={1}&alias={2}&platform={3}&forum={4}&status={5}", startDatestring, endDatestring, "fapeng", plaform, "", status))); ObservableCollection <EscalationThread> AllMyEscalationThread = new ObservableCollection <EscalationThread>(); if (HttpResponseMessage.StatusCode == HttpStatusCode.Ok) { EscalationThreadList.Items.Clear(); var result = await HttpResponseMessage.Content.ReadAsStringAsync(); AllMyEscalationThread = JsonConvert.DeserializeObject <ObservableCollection <EscalationThread> >(result); foreach (var escalationthread in AllMyEscalationThread) { EscalationAndStatusThread EscalationAndStatusThread = new EscalationAndStatusThread(); EscalationAndStatusThread.EscalationThread = escalationthread; EscalationAndStatusThread.EscalationStatusList = EscalatonStatusList.MyEscalationStatusList; EscalationThreadList.Items.Add(EscalationAndStatusThread); } Task <bool> tk = LogSearchCaseStatesExist(AllMyEscalationThread); bool a = await tk; } return(EscalationThreadList); }
// 提交修改状态功能---------------------------------------------------- private void DataGridComboBoxStatus_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox DataGridComboBoxStatus = new ComboBox(); DataGridComboBoxStatus = sender as ComboBox; EscalationStatus statusitem = DataGridComboBoxStatus.SelectedItem as EscalationStatus; EscalationAndStatusThread escalationAndStatusThread = DataGridComboBoxStatus.DataContext as EscalationAndStatusThread; EscalationThread = escalationAndStatusThread.EscalationThread; EscalationThread.Status = statusitem.Status; if (statusitem.Status.Equals("Closed: Escalated")) { EscalationPopup.IsOpen = true; } else { FTEEscalationThreadViewModel.ModifyStatus(EscalationThread); } }
private async void DataGridComboBoxStatus_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox DataGridComboBoxStatus = new ComboBox(); DataGridComboBoxStatus = sender as ComboBox; EscalationAndStatusThread EscalationAndStatusThread = (EscalationAndStatusThread)(sender as ComboBox).DataContext; string ThreadId = EscalationAndStatusThread.EscalationThread.ThreadID; string ThreadUrl = EscalationAndStatusThread.EscalationThread.Url; DateTime CreatedDateTime = DateTime.Now; string CreatedBy = EscalationAndStatusThread.EscalationThread.FteAlias; EscalationStatus MyEscalationStatus = new EscalationStatus(); MyEscalationStatus = DataGridComboBoxStatus.SelectedItem as EscalationStatus; string Status = MyEscalationStatus.Status; string SrescalationId = "N/A"; MessageDialog dialog = new MessageDialog("Modify the Status Successfully"); await dialog.ShowAsync(); }
private async void QueryButton_Click(object sender, RoutedEventArgs e) { HttpClient HttpClient = new HttpClient(); Product MyProduct = new Product(); MyProduct = PlatformComboBox.SelectedItem as Product; string plaform = MyProduct.Platform; EscalationStatus MyEscalationStatus = new EscalationStatus(); MyEscalationStatus = StatusComboBox.SelectedItem as EscalationStatus; string status = MyEscalationStatus.Status; DateTime startDate = DateTime.Parse(StartDatePicker.Date.ToString()); string startDatestring = startDate.ToString("MM-dd-yyyy"); DateTime endDate = DateTime.Parse(EndDatePicker.Date.ToString()); string endDatestring = endDate.ToString("MM-dd-yyyy"); var HttpResponseMessage = await HttpClient.GetAsync(new Uri(string.Format("http://escalationmanagerwebapi.azurewebsites.net/api/ethreads?etime1={0}&etime2={1}&alias={2}&platform={3}&forum={4}&status={5}", startDatestring, endDatestring, "fapeng", plaform, "", status))); ObservableCollection <EscalationThread> AllMyEscalationThread = new ObservableCollection <EscalationThread>(); if (HttpResponseMessage.StatusCode == HttpStatusCode.Ok) { EscalationThreadList.Items.Clear(); var result = await HttpResponseMessage.Content.ReadAsStringAsync(); AllMyEscalationThread = JsonConvert.DeserializeObject <ObservableCollection <EscalationThread> >(result); foreach (var escalationthread in AllMyEscalationThread) { EscalationAndStatusThread EscalationAndStatusThread = new EscalationAndStatusThread(); EscalationAndStatusThread.EscalationThread = escalationthread; EscalationAndStatusThread.EscalationStatusList = EscalatonStatusList; EscalationThreadList.Items.Add(EscalationAndStatusThread); } } ComboBoxItem curItem = (ComboBoxItem)PageComboBox.SelectedItem; pageSize = Convert.ToInt32(curItem.Content.ToString()); if (EscalationThreadList.Count == 0) { AllRecords.Text = "0"; AllPageIndex.Text = "0"; PageTxt.Text = "0"; } else { AllRecords.Text = EscalationThreadList.Count.ToString(); AllPageIndex.Text = GetPageIndex().ToString(); int AllPagesIndex = GetPageIndex(); PageTxt.Text = "1"; if (EscalationThreadList.Count >= 10) { MyScrollView.Height = 650; } if (AllPagesIndex == 1) { DataGrid.ItemsSource = EscalationThreadList; } else { var EscalationThreadListPage = EscalationThreadList.Skip(0 * pageSize).Take(pageSize).ToList(); DataGrid.ItemsSource = EscalationThreadListPage; } } }