Exemplo n.º 1
0
 private void dataGridViewPayrollItems_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridViewPayrollItems.SelectedRows.Count != 0)
     {
         try
         {
             DAL.PayrollItem payrollitem  = (DAL.PayrollItem)bindingSourcePayrollItems.Current;
             List <string>   defaultItems = new List <string>()
             {
                 "BASIC", "PAYE", "NSSF", "NHIF", "NON_CASH_BENEFIT", "HOURLY_PAY", "ADVANCE"
             };
             if (defaultItems.Contains(payrollitem.Id.Trim()))
             {
                 MessageBox.Show("Cannot Edit Default Payroll Item " + payrollitem.Id.Trim(), "SB Payroll", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 Forms.EditPayrollItem f = new EditPayrollItem(payrollitem, connection)
                 {
                     Owner = this
                 };
                 f.Text = payrollitem.Id.ToString().Trim().ToUpper();
                 f.ShowDialog();
             }
         }
         catch (Exception ex)
         {
             Utils.ShowError(ex);
         }
     }
 }
Exemplo n.º 2
0
 private void btnViewDetails_Click(object sender, EventArgs e)
 {
     if (dataGridViewPayrollItems.SelectedRows.Count != 0)
     {
         try
         {
             DAL.PayrollItem       payrollitem = (DAL.PayrollItem)bindingSourcePayrollItems.Current;
             Forms.EditPayrollItem f           = new EditPayrollItem(payrollitem, connection)
             {
                 Owner = this
             };
             f.Text = payrollitem.Id.ToString().Trim().ToUpper();
             f.DisableControls();
             f.ShowDialog();
         }
         catch (Exception ex)
         {
             Utils.ShowError(ex);
         }
     }
 }