Example #1
0
        private void FillSalStructureDeatailsTogrid()
        {
            objHRinfo = new HRInfo();
            DataTable dt = new DataTable();

            dgvSaltructDetails.Rows.Clear();

            if (cbSalStructType.SelectedIndex > 0)
            {
                try
                {
                    dt = objHRinfo.Get_SalaryStructureDetails(cbSalStructType.Tag.ToString()).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            dgvSaltructDetails.Rows.Add();

                            dgvSaltructDetails.Rows[i].Cells["SLNO"].Value        = (i + 1).ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalStruType"].Value = dt.Rows[i]["SalStruType"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalStruCode"].Value = dt.Rows[i]["SalStruCode"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["DesigCode"].Value   = dt.Rows[i]["DesigCode"].ToString();

                            dgvSaltructDetails.Rows[i].Cells["DesignName"].Value = dt.Rows[i]["DesignName"].ToString();

                            dgvSaltructDetails.Rows[i].Cells["EffectFrom"].Value    = Convert.ToDateTime(dt.Rows[i]["EffectFrom"].ToString()).ToShortDateString();
                            dgvSaltructDetails.Rows[i].Cells["EffectTo"].Value      = dt.Rows[i]["EffectTo"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalStatus"].Value     = dt.Rows[i]["SalStatus"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalBasic"].Value      = dt.Rows[i]["SalBasic"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalHra"].Value        = dt.Rows[i]["SalHra"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalCca"].Value        = dt.Rows[i]["SalCca"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalConvAlw"].Value    = dt.Rows[i]["SalConvAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalLTAAlw"].Value     = dt.Rows[i]["SalLTAAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalSpecialAlw"].Value = dt.Rows[i]["SalSpecialAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalUnfAlw"].Value     = dt.Rows[i]["SalUnfAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalvehicleAlw"].Value = dt.Rows[i]["SalvehicleAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalChildAlw"].Value   = dt.Rows[i]["SalChildAlw"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalBnpAlw"].Value     = dt.Rows[i]["SalBnpAlw"].ToString();

                            dgvSaltructDetails.Rows[i].Cells["SalMedReimb"].Value = dt.Rows[i]["SalMedReimb"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["SalpET"].Value      = dt.Rows[i]["SalpET"].ToString();
                            dgvSaltructDetails.Rows[i].Cells["Gross"].Value       = dt.Rows[i]["SalGross"].ToString();
                        }
                    }
                }


                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    objHRinfo = null;
                    dt        = null;
                }
            }
        }