Example #1
0
 public static PayCheckFrm GetInstance()
 {
     if (singleton == null)
     {
         singleton = new PayCheckFrm();
     }
     return(singleton);
 }
Example #2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 8)
     {
         // detail
         ClientDetail cd = ClientDetail.GetInstance();
         cd.MdiParent = this.MdiParent;
         cd.Show();
         cd.SetData(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
     }
     else if (e.ColumnIndex == 9)
     {
         // payroll
         string accNum = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         string sql    = "select * from ClientPayroll where AccNum='" + accNum + "'";
         if (DBOperator.QuerySql(sql).Rows.Count == 0)
         {
             MessageBox.Show("This client doesn't have Payroll");
             return;
         }
         ClientPayroll ci = ClientPayroll.GetInstance();
         ci.MdiParent = this.MdiParent;
         ci.Show();
         ci.SetData(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
     }
     else if (e.ColumnIndex == 10)
     {
         string accNum = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         string sql    = "select * from ClientPayroll where AccNum='" + accNum + "' and PayFreq<>'Quarterly'";
         if (DBOperator.QuerySql(sql).Rows.Count == 0)
         {
             MessageBox.Show("This client doesn't need Paycheck");
             return;
         }
         // paycheck
         PayCheckFrm pcf = PayCheckFrm.GetInstance();
         pcf.MdiParent = this.MdiParent;
         pcf.Show();
         pcf.SetAccNum(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
     }
 }
Example #3
0
 private void PayCheckFrm_FormClosed(object sender, FormClosedEventArgs e)
 {
     singleton = null;
 }