Example #1
0
        private void RadioButtonDataGridChecked(object sender, RoutedEventArgs e)
        {
            TextBoxGlobalName.IsEnabled = true;
            ComboBoxStatus.IsEnabled    = true;
            ButtonSave.IsEnabled        = true;

            var radioButton = sender as RadioButton;

            if (radioButton != null)
            {
                // ReSharper disable PossibleInvalidOperationException
                if (radioButton.IsChecked.Value || radioButton.DataContext != null)
                // ReSharper restore PossibleInvalidOperationException
                {
                    m_selectRadioButton = radioButton;

                    var globalRegion = (QueryLogConfigService.LogGlobalRegionBody)m_selectRadioButton.DataContext;

                    MaintainArea.DataContext = new MaintainLogConfigService.LogGlobalRegionBody
                    {
                        GlobalID   = globalRegion.GlobalID,
                        GlobalName = globalRegion.GlobalName,
                        Status     =
                            ContractConvert.ConvertFromQueryToMaintain(
                                globalRegion.Status)
                    };
                }
            }
        }
        private void RadioButtonChecked(object sender, RoutedEventArgs e)
        {
            // ReSharper disable PossibleInvalidOperationException
            if (((RadioButton)sender).IsChecked.Value && ((RadioButton)sender).DataContext != null)
            // ReSharper restore PossibleInvalidOperationException
            {
                m_selectedIdx = DataGridLogCategory.SelectedIndex;
                if (!ButtonSave.IsEnabled)
                {
                    ButtonSave.IsEnabled = true;
                }

                m_selectedRadioButton = sender as RadioButton;

                ((UserControl)MaintainArea.Children[0]).IsEnabled = true;

                var category         = (QueryLogConfigService.LogCategoryBody)m_selectedRadioButton.DataContext;
                var maintainCategory = new MaintainLogConfigService.LogCategoryBody
                {
                    CategoryDescription = category.CategoryDescription,
                    CategoryName        = category.CategoryName,
                    EnableRemoveLog     = category.EnableRemoveLog,
                    GlobalID            = category.GlobalID,
                    GlobalName          = category.GlobalName,
                    InDate           = category.InDate,
                    InUser           = category.InUser,
                    LocalID          = category.LocalID,
                    LocalName        = category.LocalName,
                    LogType          = ContractConvert.ConvertFromQueryToMaintain(category.LogType),
                    RemoveOverDays   = category.RemoveOverDays,
                    MyRemoveOverDays = category.RemoveOverDays.ToString(),
                    Status           = ContractConvert.ConvertFromQueryToMaintain(category.Status)
                };
                if (category.EmailNotification != null)
                {
                    maintainCategory.EmailNotification = new MaintainLogConfigService.EmailNotificationConfig
                    {
                        Address         = category.EmailNotification.Address,
                        FilterDuplicate =
                            category.EmailNotification.FilterDuplicate,
                        Interval   = category.EmailNotification.Interval,
                        NeedNotify = category.EmailNotification.NeedNotify,
                        Subject    = category.EmailNotification.Subject
                    };
                }

                ((MaintainLogCategory)MaintainArea.Children[0]).BindDataContext(maintainCategory);
            }
        }
        private void RadioButtonDataGridChecked(object sender, RoutedEventArgs e)
        {
            TextBoxLocalName.IsEnabled    = true;
            ComboBoxLocalStatus.IsEnabled = true;
            ButtonSave.IsEnabled          = true;
            var radioButton = (RadioButton)sender;

            if (radioButton.IsChecked != null)
            {
                if (radioButton.IsChecked.Value || radioButton.DataContext != null)
                {
                    m_selectedRadioButton = radioButton;
                    var localRegion = (QueryLogConfigService.LogLocalRegionBody)m_selectedRadioButton.DataContext;
                    MaintainArea.DataContext = new MaintainLogConfigService.LogLocalRegionBody
                    {
                        GlobalID   = localRegion.GlobalID,
                        GlobalName = localRegion.GlobalName,
                        LocalID    = localRegion.LocalID,
                        LocalName  = localRegion.LocalName,
                        Status     = ContractConvert.ConvertFromQueryToMaintain(localRegion.Status)
                    };
                }
            }
        }