public void OnShowEmployeeRoles() { //Emloyee roles rolesData = new EclipsePOS.WPF.SystemManager.Data.employeeRolesDataSet(); EclipsePOS.WPF.SystemManager.Data.employeeRolesDataSetTableAdapters.employee_rolesTableAdapter rolesTa = new EclipsePOS.WPF.SystemManager.Data.employeeRolesDataSetTableAdapters.employee_rolesTableAdapter(); rolesTa.Fill(rolesData.employee_roles); View.SetEmployeeRolesDataContext(rolesData.employee_roles); _colView = CollectionViewSource.GetDefaultView(rolesData.employee_roles) as CollectionView; rolesTaManager.employee_rolesTableAdapter = rolesTa; roleEventData = new EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSet(); EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter roleEventTa = new EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter(); roleEventTa.Fill(roleEventData.employee_role_event); View.SetEmployeeRoleEventDataContext(roleEventData.employee_role_event); _colViewSelectedRoleEvents = CollectionViewSource.GetDefaultView(roleEventData.employee_role_event) as CollectionView; roleEventTaManager.employee_role_eventTableAdapter = roleEventTa; //Organization organizationData = new EclipsePOS.WPF.SystemManager.Data.organizationLookupDataSet(); EclipsePOS.WPF.SystemManager.Data.organizationLookupDataSetTableAdapters.organizationTableAdapter organizationTa = new EclipsePOS.WPF.SystemManager.Data.organizationLookupDataSetTableAdapters.organizationTableAdapter(); organizationTa.Fill(organizationData.organization); View.SetOrganizationDataContext(organizationData.organization); View.SetMoveToFirstBtnDataContext(MoveToFirstCommand); View.SetMoveToPreviousBtnDataContext(MoveToPreviousCommand); View.SetMoveToNextBtnDataContext(MoveToNextCommand); View.SetMoveToLastBtnDataContext(MoveToLastCommand); View.SetDeleteBtnDataContext(DeleteCommand); View.SetAddBtnDataContext(AddCommand); View.SetRevertBtnDataContext(RevertCommand); View.SetSaveBtnDataContext(SaveCommand); // string appPath = System.IO.Path.GetDirectoryName( // System.Reflection.Assembly.GetExecutingAssembly().CodeBase)+"\\ManagedPosEvents.xml"; View.SetManagedPosEventDataContext(managedRoleEvent);//appPath); View.SetAddEventDataContext(AddEventCommand); View.SetRemoveEventDataContext(RemoveEventCommand); _colView.CurrentChanged += new EventHandler(_colView_CurrentChanged); }
//EmployeeRolesEvent private void EmployeeRolesEventData() { try { EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSet dataSetXml = new employeeRoleEventDataSet(); dataSetXml.ReadXml(View.InputFolderPath() + "\\EmployeeRoleEvents.xml", XmlReadMode.ReadSchema); EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSet dataSetRDB = new employeeRoleEventDataSet(); EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter tableAdapter = new EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter(); tableAdapter.Fill(dataSetRDB.employee_role_event); dataSetRDB.Merge(dataSetXml); tableAdapter.Update(dataSetRDB); } catch (Exception e) { //Microsoft.Windows.Controls.MessageBox.Show(e.ToString()); return; } }
//EmployeeRolesEvents Data private void EmployeeRolesEventData() { try { EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSet employeeRolesEventDataSet = new employeeRoleEventDataSet(); EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter employeeRolesEventTableAdapter = new EclipsePOS.WPF.SystemManager.Data.employeeRoleEventDataSetTableAdapters.employee_role_eventTableAdapter(); employeeRolesEventTableAdapter.Fill(employeeRolesEventDataSet.employee_role_event); employeeRolesEventDataSet.WriteXml(View.OutputFolderPath() + "\\EmployeeRoleEvents.xml", XmlWriteMode.WriteSchema); } catch (Exception e) { //Microsoft.Windows.Controls.MessageBox.Show(e.ToString()); } }