Пример #1
0
        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;

        }
Пример #2
0
        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);
        }