private DataTable SalaryPackageSearchFromDB(string packageName, string status)
 {
     try
     {
         SalaryPackageSP spSalarayPackage = new SalaryPackageSP();
         DataTable       dtbl             = spSalarayPackage.SalaryPackageregisterSearch(packageName, status);
         return(dtbl);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
        public List <DataTable> SalaryPackageregisterSearch(string strSalaryPackageName, string strStatus)
        {
            List <DataTable> ListObj = new List <DataTable>();

            try
            {
                ListObj = SalaryPackage.SalaryPackageregisterSearch(strSalaryPackageName, strStatus);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AL2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(ListObj);
        }
Beispiel #3
0
        /// <summary>
        /// Function to fill Datagridview
        /// </summary>
        public void GridFill()
        {
            string strCmbName = string.Empty;

            try
            {
                SalaryPackageSP spSalaryPackage   = new SalaryPackageSP();
                DataTable       dtblSalaryPackage = new DataTable();
                if (cmbStatus.Text == "Yes")
                {
                    strCmbName = "True";
                }
                else if (cmbStatus.Text == "No")
                {
                    strCmbName = "False";
                }
                else
                {
                    strCmbName = "All";
                }

                dtblSalaryPackage = spSalaryPackage.SalaryPackageregisterSearch(txtPackageName.Text.Trim(), strCmbName);
                dgvSalaryPackageRegister.DataSource = dtblSalaryPackage;
                int inRowCount = dgvSalaryPackageRegister.RowCount;
                for (int i = 0; i < inRowCount; i++)
                {
                    if (dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value.ToString() == "1")
                    {
                        dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value = "Yes";
                    }

                    if (dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value.ToString() == "0")
                    {
                        dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value = "No";
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SPR1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }