Esempio n. 1
0
        void QueryLogConfigClientGetLocalRegionCompleted(object sender, GetLocalRegionCompletedEventArgs e)
        {
            if (Window.FaultHandle.Handle(e))
            {
                return;
            }
            List <QueryLogConfigService.LogLocalRegionBody> list;

            if (e.Result.ResultList != null && e.Result.ResultList.Count() > 0)
            {
                list = new List <QueryLogConfigService.LogLocalRegionBody>(e.Result.ResultList);
            }
            else
            {
                list = new List <QueryLogConfigService.LogLocalRegionBody>();
            }
            list.Insert(0, new QueryLogConfigService.LogLocalRegionBody
            {
                LocalName = CommonResource.ComboBox_ExtraAllText
            });
            ComboBoxLocal.ItemsSource = list;

            var criteria = GridSearchArea.DataContext as CategoryQueryModel;

            if (criteria != null)
            {
                ComboBoxLocal.SelectedValue = criteria.LocalID;
            }
            else
            {
                ComboBoxLocal.SelectedIndex = 0;
            }

            if (!m_isLoaded)
            {
                if (Request != null && Request.QueryString != null && Request.QueryString.Count > 0)
                {
                    ((CategoryQueryModel)GridSearchArea.DataContext).CategoryName = Request.QueryString["CategoryName"];

                    ((CategoryQueryModel)GridSearchArea.DataContext).LocalID = Request.QueryString["LocalID"];
                    ButtonSearch_Click(null, null);
                }
            }

            if (m_criteria != null)
            {
                ComboBoxLocal.SelectedValue = m_criteria.LocalID;
                if (DataGridLogCategory.ItemsSource != null && m_isUpdateLocalOrGlobal)
                {
                    ButtonSearch_Click(null, null);
                }
            }
        }
Esempio n. 2
0
        void QueryLogConfigClientGetLocalRegionCompleted(object sender, GetLocalRegionCompletedEventArgs e)
        {
            if (m_logCategoryConfig.Window.FaultHandle.Handle(e))
            {
                return;
            }
            var observableCollection = new ObservableCollection <QueryLogConfigService.LogLocalRegionBody>();

            foreach (var item in e.Result.ResultList)
            {
                observableCollection.Add(item);
            }
            DataGridLocalInfos.ItemsSource = observableCollection;

            this.ButtonNew.IsEnabled    = true;
            this.ButtonCancel.IsEnabled = true;
        }
Esempio n. 3
0
        void QueryLogConfigClientGetLocalRegionCompleted(object sender, GetLocalRegionCompletedEventArgs e)
        {
            if (m_logCategoryConfig.Window.FaultHandle.Handle(e))
            {
                return;
            }

            var result = m_isEdit ? e.Result.ResultList : FilterInActiveLocalRegion(e.Result.ResultList);

            ComboBoxLocal.ItemsSource = result;
            if (m_selectedLocalId != null)
            {
                ComboBoxLocal.SelectedValue = m_selectedLocalId;
            }
            else
            {
                ComboBoxLocal.SelectedIndex = 0;
            }
        }
Esempio n. 4
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;
                }
            }
        }