Ejemplo n.º 1
0
        private void GetPenalty_Click(object sender, EventArgs e)
        {
            Payroll_Controller emp = new Payroll_Controller();
            DataTable          d   = emp.PayrollSelectEmployee(Convert.ToDouble(txtIDS.Text), dtpDateFrom.Value, dtpDateTo.Value, Convert.ToDouble(txtDepartment.Text));

            txtPenalty.Text = d.Rows[0].ItemArray[6].ToString();
        }
Ejemplo n.º 2
0
 private void cmdGetWorkedDays_Click(object sender, EventArgs e)
 {
     try
     {
         Payroll_Controller emp = new Payroll_Controller();
         DataTable          d   = emp.PayrollSelectEmployee(Convert.ToDouble(txtIDS.Text), dtpDateFrom.Value, dtpDateTo.Value, Convert.ToDouble(txtDepartment.Text));
         txtWorkDays.Text = d.Rows[0].ItemArray[1].ToString();
     }
     catch { }
 }
Ejemplo n.º 3
0
        private void PayrollInitalListGet()
        {
            try
            {
                Payroll_Controller payrollGetInitial = new Payroll_Controller();
                dgvPayroll.DataSource = payrollGetInitial.PayrollSelectInitial(dtpFrom.Value, dtpTo.Value, Convert.ToDouble(cboDepartment.SelectedValue),
                                                                               Convert.ToInt32(chkSSSPrem.CheckState), Convert.ToInt32(chkPHICPrem.CheckState),
                                                                               Convert.ToInt32(chkPagIBIGPrem.CheckState), Convert.ToInt32(chkSSSLoan.CheckState),
                                                                               Convert.ToInt32(chkPagIBIGLoan.CheckState), Convert.ToInt32(chkSavings.CheckState));

                dgvPayroll.Columns[0].Visible   = false;
                dgvPayroll.Columns[1].Visible   = false;
                dgvPayroll.Columns[2].Width     = 200;
                dgvPayroll.Columns[2].ReadOnly  = true;
                dgvPayroll.Columns[3].ReadOnly  = true;
                dgvPayroll.Columns[4].ReadOnly  = true;
                dgvPayroll.Columns[5].ReadOnly  = true;
                dgvPayroll.Columns[6].ReadOnly  = true;
                dgvPayroll.Columns[8].ReadOnly  = true;
                dgvPayroll.Columns[16].ReadOnly = true;
                dgvPayroll.Columns[17].ReadOnly = true;
                dgvPayroll.Columns[19].ReadOnly = true;
                dgvPayroll.Columns[3].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[4].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[5].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[6].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[7].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[8].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[9].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[10].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[11].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[12].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[13].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[14].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[15].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[16].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[17].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[18].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[19].DefaultCellStyle.Format = "###,##0.00##";

                dgvPayroll.Columns[0].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[1].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[2].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[3].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[4].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[5].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[6].ValueType = System.Type.GetType("System.Decimal");
                dgvPayroll.Columns[7].ValueType = System.Type.GetType("System.Decimal");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 4
0
        private void PayrollList()
        {
            try
            {
                Payroll_Controller payroll = new Payroll_Controller();

                dgvPayroll.DataSource = payroll.PayrollList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 5
0
 private void dgvPayroll_KeyUp(object sender, KeyEventArgs e)
 {
     if ((e.KeyCode & Keys.Delete) == Keys.Delete)
     {
         // Show the user a message
         DialogResult result = MessageBox.Show("Do you want to Delete?", "Confirmation", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             DataGridViewRow    row        = dgvPayroll.CurrentCell.OwningRow;
             Payroll_Controller payrollEmp = new Payroll_Controller();
             payrollEmp.PayrollEmployeeDelete(Convert.ToDouble(row.Cells["IDS"].Value));
             PayrollEmployeeGet(Convert.ToDouble(txtIDS.Text));
             e.Handled = true;
         }
     }
 }
Ejemplo n.º 6
0
        public void PayrollEmployeeGet(double IDS)
        {
            try
            {
                Payroll_Controller payroll = new Payroll_Controller();
                dgvPayroll.DataSource = payroll.PayrollEmployeeSelect(IDS);

                dgvPayroll.Columns[0].Visible = false;
                dgvPayroll.Columns[1].Visible = false;

                dgvPayroll.Columns[2].ReadOnly  = true;
                dgvPayroll.Columns[3].ReadOnly  = true;
                dgvPayroll.Columns[4].ReadOnly  = true;
                dgvPayroll.Columns[5].ReadOnly  = true;
                dgvPayroll.Columns[6].ReadOnly  = true;
                dgvPayroll.Columns[8].ReadOnly  = true;
                dgvPayroll.Columns[16].ReadOnly = true;
                dgvPayroll.Columns[17].ReadOnly = true;
                dgvPayroll.Columns[19].ReadOnly = true;
                //  dgvPayroll.Columns[2].Width = 200;
                dgvPayroll.Columns[3].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[4].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[5].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[6].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[7].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[8].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[9].DefaultCellStyle.Format  = "###,##0.00##";
                dgvPayroll.Columns[10].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[11].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[12].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[13].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[14].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[15].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[16].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[17].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[18].DefaultCellStyle.Format = "###,##0.00##";
                dgvPayroll.Columns[19].DefaultCellStyle.Format = "###,##0.00##";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 7
0
        private void PayrollInserts()
        {
            try
            {
                Payroll_Controller payroll = new Payroll_Controller();
                Double             IDS     = payroll.PayrollInsert(Convert.ToDouble(txtIDS.Text), DateTime.Today, dtpFrom.Value, dtpTo.Value, Convert.ToDouble(cboDepartment.SelectedValue), txtRemarks.Text);
                if (IDS > 0)
                {
                    foreach (DataGridViewRow dr in dgvPayroll.Rows)
                    {
                        Double IDS1 = payroll.PayrollEmployeeInsert(Convert.ToDouble(dValue(dr.Cells["IDS"].Value.ToString()))
                                                                    , Convert.ToDouble(dr.Cells["EmployeeIDS"].Value.ToString())
                                                                    , IDS
                                                                    , Convert.ToDouble(cboDepartment.SelectedValue)
                                                                    , dValue(dr.Cells["Days Worked"].Value.ToString())
                                                                    , dValue(dr.Cells["Rate"].Value.ToString())
                                                                    , dValue(dr.Cells["OT Hour"].Value.ToString())
                                                                    , dValue(dr.Cells["OTRate"].Value.ToString())
                                                                    , dValue(dr.Cells["Adjustment"].Value.ToString())
                                                                    , dValue(dr.Cells["SSSPrem"].Value.ToString())
                                                                    , dValue(dr.Cells["PHICPrem"].Value.ToString())
                                                                    , dValue(dr.Cells["PagIbigPrem"].Value.ToString())
                                                                    , dValue(dr.Cells["SSSLoan"].Value.ToString())
                                                                    , dValue(dr.Cells["PagIbigLoan"].Value.ToString())
                                                                    , dValue(dr.Cells["CashAdvance"].Value.ToString())
                                                                    , dValue(dr.Cells["Savings"].Value.ToString())
                                                                    , dValue(dr.Cells["OtherDeduction"].Value.ToString())
                                                                    , dValue(dr.Cells["Late|EO"].Value.ToString())
                                                                    , dValue(dr.Cells["Penalty"].Value.ToString()));
                    }
                }

                MessageBox.Show("Save Successfull");
                PayrollGet(IDS);
                PayrollEmployeeGet(IDS);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 8
0
        public void PayrollGet(double ids)
        {
            try
            {
                Payroll_Controller payroll = new Payroll_Controller();

                foreach (DataRow row in payroll.PayrollSelect(ids).Rows)
                {
                    txtIDS.Text   = row["IDS"].ToString();
                    dtpFrom.Value = Convert.ToDateTime(row["DateFrom"].ToString());
                    dtpTo.Value   = Convert.ToDateTime(row["DateTo"].ToString());
                    cboDepartment.SelectedValue = row["Department"].ToString();
                    txtRemarks.Text             = row["Remarks"].ToString();
                }
            }


            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }