Exemplo n.º 1
0
        private void serviceClient_GetGlobalRegionCompleted(object sender, GetGlobalRegionCompletedEventArgs e)
        {
            if (this.Window.FaultHandle.Handle(e))
            {
                return;
            }

            if (e.Result.ResultList != null)
            {
                LogGlobalRegionBody firstItem = new LogGlobalRegionBody()
                {
                    GlobalID   = null,
                    GlobalName = CommonResource.ComboBox_ExtraAllText
                };
                List <LogGlobalRegionBody> list = e.Result.ResultList.ToList();
                list.Insert(0, firstItem);

                this.ddlGlobal.ItemsSource = list;

                LogQueryModel queryModel = e.UserState as LogQueryModel;
                if (queryModel != null)
                {
                    this.ddlGlobal.SelectedValue = queryModel.GlobalID;
                }
                else
                {
                    this.ddlGlobal.SelectedIndex = 0;
                }
            }

            this.DataGridLogList.QueryCriteria = GridSearchArea.DataContext;
            this.DataGridLogList.Bind();
        }
Exemplo n.º 2
0
        private void ddlGlobal_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LogGlobalRegionBody selectedItem = this.ddlGlobal.SelectedItem as LogGlobalRegionBody;

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

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