Esempio n. 1
0
        private HR_LANGUAGE EditingLastLanguageInfo;                        //Stores what we're editing right now, Incase we need to cancel the edit

        public HRLanguageModel(HRLanguages language)
        {
            this.language = language;

            //The search control needs to know the method it has to use inorder to search. So we pass a method
            language.HRLanguageSearchControl.Search = Search;


            language.HRLanguageSearchControl.ResultsGrid.SelectedCellsChanged += dgv_HRLanguage_SelectionChanged;
            language.LanguageGrid.SourceUpdated += LanguageGrid_SourceUpdated;
            //This is a event which fires whenever newitems arrive at the datagrid
            var dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGrid));

            if (dpd != null)
            {
                dpd.AddValueChanged(language.HRLanguageSearchControl.ResultsGrid, ItemSourceChanged);
            }
            Search(language.HRLanguageSearchControl);  //Initial Search to fill datagrid with values at startup
        }
Esempio n. 2
0
        private HR_EMP_LANGUAGE EditingLastBenefitInfo;                         //Stores what we're editing right now, in case we need to cancel the edit

        public HREmpLanguageModel(HRLanguages language)
        {
            this.language = language;

            //The search control needs to know the method it has to use inorder to search. So we pass a method
            language.HREmpLanguageSearchControl.Search  = Search;
            language.EmpLanguageEmpIdDropDown.Search    = EmployeeModel.Search;
            language.EmpLanguageLangCodeDropDown.Search = HRLanguageModel.Search;

            //Fill the combobox with the values of the [Values] attribute; See entity.cs
            language.cmb_HREmpLanguage_Type.ItemsSource = Helper.getItemSource(typeof(HR_EMP_LANGUAGE), "ELANG_TYPE");
            language.HREmpLanguageSearchControl.ResultsGrid.SelectedCellsChanged += dgv_HREmpLanguage_SelectionChanged;
            language.HREmpLanguageGrid.SourceUpdated += HREmpLanguageGrid_SourceUpdated;
            //This is a event which fires whenever newitems arrive at the datagrid
            var dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGrid));

            if (dpd != null)
            {
                dpd.AddValueChanged(language.HREmpLanguageSearchControl.ResultsGrid, ItemSourceChanged);
            }
            Search(language.HREmpLanguageSearchControl);  //Initial Search to fill datagrid with values at startup
        }