Exemplo n.º 1
0
        private void dgvLeaveTypeDataGridView_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (pvtblnLeaveTypeDataGridViewLoaded == true)
            {
                if (pvtintLeaveTypeDataGridViewRowIndex != e.RowIndex)
                {
                    pvtintLeaveTypeDataGridViewRowIndex = e.RowIndex;

                    clsISUtilities.DataViewIndex = Convert.ToInt32(this.dgvLeaveTypeDataGridView[2, e.RowIndex].Value);
                    pvtintLeaveTypeNo            = Convert.ToInt32(this.pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_NO"]);

                    clsISUtilities.DataBind_DataView_Record_Show();

                    if (Convert.ToDouble(pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["LEAVE_PERCENTAGE"]) == 0)
                    {
                        this.rbnUnPaid.Checked = true;
                    }
                    else
                    {
                        this.rbnPaid.Checked = true;
                    }

                    if (pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_DEL_IND"].ToString() == "Y"
                        & Convert.ToInt32(pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_NO"]) != 200
                        & Convert.ToInt32(pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_NO"]) != 201)
                    {
                        this.btnDelete.Enabled = true;
                    }
                    else
                    {
                        this.btnDelete.Enabled = false;
                    }

                    if (Convert.ToInt32(pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_NO"]) != 200
                        & Convert.ToInt32(pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["EARNING_NO"]) != 201)
                    {
                        if (pvtLeaveTypeDataView[this.clsISUtilities.DataViewIndex]["PAYROLL_LINK"] == System.DBNull.Value)
                        {
                            this.btnUpdate.Enabled = true;
                        }
                        else
                        {
                            this.btnUpdate.Enabled = false;
                        }
                    }
                    else
                    {
                        this.btnUpdate.Enabled = false;
                    }
                }
            }
        }
        private void dgvCompanyDataGridView_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (pvtblnCompanyDataGridViewLoaded == true)
            {
                if (pvtintCompanyDataGridViewRowIndex != e.RowIndex)
                {
                    pvtintCompanyDataGridViewRowIndex = e.RowIndex;

                    clsISUtilities.DataViewIndex = Convert.ToInt32(this.dgvCompanyDataGridView[2, e.RowIndex].Value);

                    pvtint64CompanyNo = Convert.ToInt64(pvtCompanyDataView[clsISUtilities.DataViewIndex]["COMPANY_NO"]);

                    //NB clsISUtilities.DataViewIndex is used Below
                    clsISUtilities.DataBind_DataView_Record_Show();

                    if (pvtCompanyDataView[clsISUtilities.DataViewIndex]["DYNAMIC_UPLOAD_KEY"].ToString() == "")
                    {
                        this.rbnEditNo.Checked = true;
                    }
                    else
                    {
                        this.rbnEditYes.Checked = true;
                    }

                    this.txtUploadKey.Text = pvtCompanyDataView[clsISUtilities.DataViewIndex]["DYNAMIC_UPLOAD_KEY"].ToString();

                    if (Convert.ToInt32(pvtCompanyDataView[clsISUtilities.DataViewIndex]["COUNT_PAY_CATEGORY_NO_CURRENT"]) == 0)
                    {
                        this.btnUpdate.Enabled = true;
                        this.btnDelete.Enabled = true;

                        this.grbCompanyLock.Visible = false;
                    }
                    else
                    {
                        this.btnUpdate.Enabled = false;
                        this.btnDelete.Enabled = false;

                        this.grbCompanyLock.Visible = true;
                    }

                    if (AppDomain.CurrentDomain.GetData("AccessInd").ToString() == "S")
                    {
                        this.btnNew.Enabled = true;
                    }
                    else
                    {
                        this.btnNew.Enabled = false;
                    }
                }
            }
        }
        private void dgvNormalSickLeaveCategoryDataGridView_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (pvtblnNormalSickLeeaveCategoryDataGridViewLoaded == true)
            {
                if (pvtintNormalSickLeaveCategoryDataGridViewRowIndex != e.RowIndex)
                {
                    pvtintNormalSickLeaveCategoryDataGridViewRowIndex = e.RowIndex;

                    clsISUtilities.DataViewIndex = Convert.ToInt32(this.dgvNormalSickLeaveCategoryDataGridView[2, e.RowIndex].Value);

                    clsISUtilities.DataBind_DataView_Record_Show();

                    pvtintLeaveNo = Convert.ToInt32(pvtLeaveDataView[clsISUtilities.DataViewIndex]["LEAVE_SHIFT_NO"]);

                    if (pvtLeaveDataView[clsISUtilities.DataViewIndex]["LEAVE_SHIFT_DEL_IND"].ToString() == "Y")
                    {
                        this.btnDelete.Enabled = true;
                    }
                    else
                    {
                        this.btnDelete.Enabled = false;
                    }

                    if (pvtLeaveDataView[clsISUtilities.DataViewIndex]["PAYROLL_LINK"] != System.DBNull.Value)
                    {
                        this.btnUpdate.Enabled = false;
                    }
                    else
                    {
                        this.btnUpdate.Enabled = true;
                    }

                    if (pvstrPayrollType == "W")
                    {
                        this.cboMinShiftHours.SelectedIndex = Convert.ToInt32(Convert.ToInt32(pvtLeaveDataView[clsISUtilities.DataViewIndex]["MIN_VALID_SHIFT_MINUTES"]) / 60);

                        this.cboMinShiftMinutes.SelectedIndex = -1;

                        for (int intRow = 0; intRow < this.cboMinShiftMinutes.Items.Count; intRow++)
                        {
                            if (Convert.ToInt32(this.cboMinShiftMinutes.Items[intRow]) == Convert.ToInt32(Convert.ToInt32(pvtLeaveDataView[clsISUtilities.DataViewIndex]["MIN_VALID_SHIFT_MINUTES"]) % 60))
                            {
                                this.cboMinShiftMinutes.SelectedIndex = intRow;
                                break;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        private void dgvDeductionDataGridView_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (pvtblnDeductionDataGridViewLoaded == true)
            {
                if (pvtintDeductionDataGridViewRowIndex != e.RowIndex)
                {
                    pvtintDeductionDataGridViewRowIndex = e.RowIndex;

                    clsISUtilities.DataViewIndex = Convert.ToInt32(this.dgvDeductionDataGridView[3, e.RowIndex].Value);

                    pvtintDeductionNo = Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_NO"]);

                    //Load Data Bound Records
                    clsISUtilities.DataBind_DataView_Record_Show();

                    if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_DEL_IND"].ToString() == "Y")
                    {
                        if (this.pvtDataSet.Tables["Company"].Rows[0]["ACCESS_IND"].ToString() == "R")
                        {
                            this.btnDelete.Enabled = false;
                        }
                        else
                        {
                            if (grbDeductionLock.Visible == false)
                            {
                                this.btnDelete.Enabled = true;
                            }
                        }
                    }
                    else
                    {
                        this.btnDelete.Enabled = false;
                    }

                    //Tax or UIF
                    if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_NO"].ToString() == "1"
                        | Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_NO"]) == 2)
                    {
                        this.btnUpdate.Enabled = false;

                        if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_NO"].ToString() == "1")
                        {
                            this.Clear_DataGridView(this.dgvEarningDataGridView);
                        }
                    }
                    else
                    {
                        if (this.pvtDataSet.Tables["Company"].Rows[0]["ACCESS_IND"].ToString() == "R")
                        {
                            this.btnUpdate.Enabled = false;
                        }
                        else
                        {
                            if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["PAYROLL_LINK"] == System.DBNull.Value)
                            {
                                if (grbDeductionLock.Visible == false)
                                {
                                    this.btnUpdate.Enabled = true;
                                }
                            }
                            else
                            {
                                this.btnUpdate.Enabled = false;
                            }
                        }
                    }

                    //Make Percentage Fire
                    if (pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_TYPE_IND"].ToString() == "P")
                    {
                        this.rbnPercentageOfEarnings.Checked = false;
                        this.rbnPercentageOfEarnings.Checked = true;
                    }

                    this.cboDay.SelectedIndex = -1;

                    if (Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_DAY_VALUE"]) > 0)
                    {
                        if (Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_DAY_VALUE"]) == 99)
                        {
                            this.cboDay.SelectedIndex = this.cboDay.Items.Count - 1;
                        }
                        else
                        {
                            this.cboDay.SelectedIndex = Convert.ToInt32(pvtDeductionDataView[clsISUtilities.DataViewIndex]["DEDUCTION_DAY_VALUE"]) - 1;
                        }
                    }
                }
            }
        }