public void sortAll() { dgvSalary.DataSource = SalaryManagement.SelectAllSalaries(); dgvPosition.DataSource = PositionManagement.SelectAllPositions(); cmbSalary.DataSource = SalaryManagement.SelectAllSalaries(); cmbSalary.DisplayMember = "salaryAmount"; }
private void Awake() { if (Instance == null) { SetRectCorners(); Instance = this; } else { DestroyImmediate(gameObject); } }
private void deletePositionButton_Click(object sender, EventArgs e) { string id = dgvPosition.CurrentRow.Cells[0].Value.ToString(); try { if (PositionManagement.DeletePositionById(id)) { dgvPosition.DataSource = PositionManagement.SelectAllPositions(); FrmMain.Instance.ToolStripLabel.Text = "Se elimino la Posicion correctamente"; } else { FrmMain.Instance.ToolStripLabel.Text = "Error al eliminar la Posicion"; } } catch (Exception) { throw; } }
private void createPositionButton_Click(object sender, EventArgs e) { string position = txtNamePosition.Text; SalaryModel salary = (SalaryModel)cmbSalary.SelectedItem; try { if (PositionManagement.InsertPosition(position, salary.IdSalary.ToString())) { dgvPosition.DataSource = PositionManagement.SelectAllPositions(); FrmMain.Instance.ToolStripLabel.Text = "Se inserto la posicion de trabajo correctamente"; } else { FrmMain.Instance.ToolStripLabel.Text = "Error al insertar la posicion de trabajo"; } } catch (Exception) { throw; } }
private void updatePositionButton_Click(object sender, EventArgs e) { string id = dgvPosition.CurrentRow.Cells[0].Value.ToString(); string position = txtNamePosition.Text; SalaryModel salary = (SalaryModel)cmbSalary.SelectedItem; try { if (PositionManagement.UpdatePositionById(id, position, salary.IdSalary.ToString())) { dgvPosition.DataSource = PositionManagement.SelectAllPositions(); FrmMain.Instance.ToolStripLabel.Text = "Se modifico la Posicion correctamente"; } else { FrmMain.Instance.ToolStripLabel.Text = "Error al modificar la Posicion"; } } catch (Exception) { throw; } }
private void UcEmployee_Load(object sender, EventArgs e) { dgvEmployee.DataSource = EmployeeManagement.SelectAllEmployees(); cmbPosition.DataSource = PositionManagement.SelectAllPositions(); cmbPosition.DisplayMember = "positionName"; }