Beispiel #1
0
        private void serviceClient_GetLocalRegionCompleted(object sender, GetLocalRegionCompletedEventArgs e)
        {
            if (this.Window.FaultHandle.Handle(e))
            {
                return;
            }

            if (e.Result.ResultList != null)
            {
                LogLocalRegionBody firstItem = new LogLocalRegionBody()
                {
                    GlobalID  = null,
                    LocalID   = null,
                    LocalName = CommonResource.ComboBox_ExtraAllText
                };
                List <LogLocalRegionBody> list = e.Result.ResultList.ToList();
                for (int i = list.Count - 1; i >= 0; i--)
                {
                    if (list[i].Status == Status.Inactive)
                    {
                        list.Remove(list[i]);
                    }
                }
                list.Insert(0, firstItem);

                this.ddlLocal.ItemsSource = list;
                this.ddlLocal.IsEnabled   = true;


                this.ddlCategory.IsEnabled = false;

                LogQueryModel queryModel = e.UserState as LogQueryModel;
                if (queryModel != null)
                {
                    this.ddlLocal.SelectedValue = queryModel.LocalID;
                }
                else
                {
                    this.ddlLocal.SelectedIndex = 0;
                }
            }
        }
Beispiel #2
0
        private void ddlLocal_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LogLocalRegionBody selectedItem = this.ddlLocal.SelectedItem as LogLocalRegionBody;

            if (selectedItem != null && selectedItem.GlobalID != null && selectedItem.LocalID != null)
            {
                LogCategoryQueryCriteria queryCriteria = new LogCategoryQueryCriteria()
                {
                    GlobalID = selectedItem.GlobalID,
                    LocalID  = selectedItem.LocalID,
                    Status   = Status.Active
                };

                var dataSource = GridSearchArea.DataContext;
                ddlCategory.IsShowLoading = true;
                this.m_queryLogConfigClient.GetCategoryConfigsAsync(queryCriteria, dataSource);
            }
            else
            {
                this.ddlCategory.ItemsSource = null;
                this.ddlCategory.IsEnabled   = false;
            }
        }