private void BtnSave_Click(object sender, System.Windows.RoutedEventArgs e) { try { DesignationItem item = new DesignationItem(); if (string.IsNullOrEmpty(selectedPosId)) { if (posValidation()) { item._POS_NAME = tbJobTitle.Text; item._POS_DEPARTMENT = tbDepartment.Text; SaveDesignationDetails(item); } } else { item._POS_ID = int.Parse(selectedPosId); item._POS_NAME = tbJobTitle.Text; item._POS_DEPARTMENT = tbDepartment.Text; UpdateDesignationDetails(item); } PositionCollection myPosList = new PositionCollection(); myPosList.RetreiveAllPositions(); } catch (System.Exception) { MessageBox.Show("Cannot connect to server", "Error"); } }
private void DeletePosition() { PositionManager myManager = new PositionManager(); myManager.DeleteDesignation(selectedPosId); PositionCollection myPosList = new PositionCollection(); myPosList.RetreiveAllPositions(); }
private void BtnSave_Click(object sender, System.Windows.RoutedEventArgs e) { if (posValidation()) { DesignationItem item = new DesignationItem(); item._POS_NAME = tbJobTitle.Text; item._POS_DEPARTMENT = tbDepartment.Text; try { SaveDesignationDetails(item); ClearInputFields(); MessageBox.Show("New Position added."); } catch (System.Exception) { MessageBox.Show("Error saving new employee."); } PositionCollection myPosList = new PositionCollection(); myPosList.RetreiveAllPositions(); } }
private void getAllJobPositions() { myPosCollection.RetreiveAllPositions(); }