public FTE_Reports_EscalationThread() { this.InitializeComponent(); this.EndDatePicker.Date = DateTime.Today; int date = DateTime.Today.Day; this.StartDatePicker.Date = DateTime.Today.AddDays(-(date - 1)); FTEEscalationReportViewModel = new FTEEscalationReportViewModel(); AllMyPlatform = new ProductWithSelectedItem(); this.SizeChanged += FTE_Reports_EscalationThread_SizeChanged; this.Loaded += FTE_Reports_EscalationThread_Loaded; }
public static async Task <FTEEscalationReportViewModel> GetFTEEscalationReportViewModel() { var FTEEscalationReportViewModel = new FTEEscalationReportViewModel(); FTEEscalationReportViewModel.AllPratfromList = new ProductWithSelectedItem(); FTEEscalationReportViewModel.AllPratfromList.MyProductList = new ObservableCollection <Product>(); FTEEscalationReportViewModel.AllPratfromList.MyProductList = await FTEEscalationReportViewModel.GetAllPlaform(); FTEEscalationReportViewModel.AllPratfromList.SelectedItem = new Product(); FTEEscalationReportViewModel.AllPratfromList.SelectedItem = FTEEscalationReportViewModel.AllPratfromList.MyProductList[0]; return(FTEEscalationReportViewModel); }
public FTE_All_EscalationThread() { this.InitializeComponent(); this.EndDatePicker.Date = DateTime.Today; int date = DateTime.Today.Day; this.StartDatePicker.Date = DateTime.Today.AddDays(-(date-1)); this.SizeChanged += FTE_All_EscalationThread_SizeChanged; EscalatonStatusList = new EscalationStatusWithSelectedItem(); AllMyPlatform = new ProductWithSelectedItem(); EscalationThreadList = new ObservableCollectionView<EscalationAndStatusThread>(); EscalationThreadListPage = new ObservableCollectionView<EscalationAndStatusThread>(); FTEEscalationThreadViewModel = new FTEEscalationThreadViewModel(); EscalationThread = new EscalationThread(); this.Loaded += FTE_All_EscalationThread_Loaded; this.DataContext = FTEEscalationThreadViewModel; }
public static async Task <VendorEscalationThreadViewModel> GetVendorEscalationThreadViewModel() { var VendorEscalationThreadViewModel = new VendorEscalationThreadViewModel(); VendorEscalationThreadViewModel.AllEscalationStatusList = new EscalationStatusWithSelectedItem(); VendorEscalationThreadViewModel.AllEscalationStatusList.MyEscalationStatusList = new ObservableCollection <EscalationStatus>(); VendorEscalationThreadViewModel.AllEscalationStatusList.MyEscalationStatusList = await VendorEscalationThreadViewModel.GetAllEScalationStatus(); VendorEscalationThreadViewModel.AllEscalationStatusList.SelectedItem = new EscalationStatus(); VendorEscalationThreadViewModel.AllEscalationStatusList.SelectedItem = VendorEscalationThreadViewModel.AllEscalationStatusList.MyEscalationStatusList[0]; VendorEscalationThreadViewModel.AllPratfromList = new ProductWithSelectedItem(); VendorEscalationThreadViewModel.AllPratfromList.MyProductList = new ObservableCollection <Product>(); VendorEscalationThreadViewModel.AllPratfromList.MyProductList = await VendorEscalationThreadViewModel.GetAllPlaform(); VendorEscalationThreadViewModel.AllPratfromList.SelectedItem = new Product(); VendorEscalationThreadViewModel.AllPratfromList.SelectedItem = VendorEscalationThreadViewModel.AllPratfromList.MyProductList[0]; return(VendorEscalationThreadViewModel); }
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); }
public async Task <ObservableCollectionView <Report> > QueryAllEscalationReport(ProductWithSelectedItem AllMyPlatform, string startDatestring, string endDatestring) { ObservableCollectionView <Report> ReportList = new ObservableCollectionView <Report>(); HttpClient HttpClient = new HttpClient(); Product MyProduct = new Product(); MyProduct = AllMyPlatform.SelectedItem; string plaform = MyProduct.Platform; var HttpResponseMessage = await HttpClient.GetAsync(new Uri(string.Format("http://escalationmanagerwebapi.azurewebsites.net/api/reports?Alias={0}&Platform={1}&Forum={2}&ETime1={3}&ETime2={4}&VFlag={5}", "All", plaform, "", startDatestring, endDatestring, false))); ObservableCollection <Report> AllMyReport = new ObservableCollection <Report>(); if (HttpResponseMessage.StatusCode == HttpStatusCode.Ok) { ReportList.Items.Clear(); var result = await HttpResponseMessage.Content.ReadAsStringAsync(); AllMyReport = JsonConvert.DeserializeObject <ObservableCollection <Report> >(result); foreach (var report in AllMyReport) { ReportList.Items.Add(report); } } return(ReportList); }