示例#1
0
        private HR_EMP_EMERGENCY EditingEmergencyContactInfomation;                  //Stores what we're editing right now, Incase we need to cancel the edit

        public EmergencyContactModel(EmergencyContact EmergencyContact)
        {
            this.EmergencyContact = EmergencyContact;

            //The search control needs to know the method it has to use inorder to search. So we pass a method
            EmergencyContact.EmergencyContactSearchControl.Search = Search;
            EmergencyContact.EmployeeNumberDropDown.Search        = EmployeeModel.Search;
            EmergencyContact.EmergencyContactSearchControl.ResultsGrid.SelectedCellsChanged += dgv_EmergencyContact_SelectionChanged;
            EmergencyContact.EmergencyContactGrid.SourceUpdated += EmergencyContactGrid_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(EmergencyContact.EmergencyContactSearchControl.ResultsGrid, ItemSourceChanged);
            }

            Search(EmergencyContact.EmergencyContactSearchControl);  //Initial Search to fill datagrid with values at startup
        }
示例#2
0
        HR_EMP_EMERGENCY EditingEmergencyContactInfomation;                  //Stores what we're editing right now, Incase we need to cancel the edit
        public EmergencyContactModel(EmergencyContact EmergencyContact)
        {
            this.EmergencyContact = EmergencyContact;

            //The search control needs to know the method it has to use inorder to search. So we pass a method
            EmergencyContact.EmergencyContactSearchControl.Search = Search;
            EmergencyContact.EmployeeNumberDropDown.Search        = EmployeeModel.Search;

            //transaction.cmb_TransactionTypLTI.ItemsSource = Helper.getItemSource(typeof(ERP_LastTransactionInfo), "TransactionType"); //Fill the combobox with the values of the [Values] attribute; See entity.cs
            // EmergencyContact.EmergencyContactSearchControl.ResultsGrid.AutoGeneratingColumn += dgv_EmergencyContact_AutoGeneratingColumn;

            EmergencyContact.EmergencyContactSearchControl.ResultsGrid.SelectionChanged += dgv_EmergencyContact_SelectionChanged;

            EmergencyContact.EmergencyContactGrid.SourceUpdated += EmergencyContactGrid_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(EmergencyContact.EmergencyContactSearchControl.ResultsGrid, ItemSourceChanged);
            }

            Search(EmergencyContact.EmergencyContactSearchControl);  //Initial Search to fill datagrid with values at startup
        }