示例#1
0
 public void sortAll()
 {
     dgvSalary.DataSource    = SalaryManagement.SelectAllSalaries();
     dgvPosition.DataSource  = PositionManagement.SelectAllPositions();
     cmbSalary.DataSource    = SalaryManagement.SelectAllSalaries();
     cmbSalary.DisplayMember = "salaryAmount";
 }
示例#2
0
 private void Awake()
 {
     if (Instance == null)
     {
         SetRectCorners();
         Instance = this;
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
示例#3
0
        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;
            }
        }
示例#4
0
        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;
            }
        }
示例#5
0
        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;
            }
        }
示例#6
0
 private void UcEmployee_Load(object sender, EventArgs e)
 {
     dgvEmployee.DataSource    = EmployeeManagement.SelectAllEmployees();
     cmbPosition.DataSource    = PositionManagement.SelectAllPositions();
     cmbPosition.DisplayMember = "positionName";
 }