/// <summary>
    /// Gets the qualification details.
    /// </summary>
    /// <returns></returns>
    private BusinessEntities.RaveHRCollection GetQualificationDetails(int employeeID)
    {
        Rave.HR.BusinessLayer.Employee.QualificationDetails objQualificationDetailsBAL;
        BusinessEntities.QualificationDetails objQualificationDetails;

        // Initialise Collection class object
        BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection();

        try
        {
            objQualificationDetailsBAL = new Rave.HR.BusinessLayer.Employee.QualificationDetails();
            objQualificationDetails    = new BusinessEntities.QualificationDetails();

            //objQualificationDetails.EMPId = 14;
            objQualificationDetails.EMPId = employeeID;

            raveHRCollection = objQualificationDetailsBAL.GetQualificationDetails(objQualificationDetails);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetQualificationDetails", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }

        return(raveHRCollection);
    }
    /// <summary>
    /// Handles the Click event of the btnSave control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Rave.HR.BusinessLayer.Employee.QualificationDetails objQualificationDetailsBAL;

        BusinessEntities.QualificationDetails objQualificationDetails;
        BusinessEntities.RaveHRCollection     objSaveQualificationDetailsCollection = new BusinessEntities.RaveHRCollection();

        try
        {
            objQualificationDetailsBAL = new Rave.HR.BusinessLayer.Employee.QualificationDetails();

            if (gvQualification.Rows[0].Cells[0].Text != NO_RECORDS_FOUND_MESSAGE)
            {
                for (int i = 0; i < gvQualification.Rows.Count; i++)
                {
                    objQualificationDetails = new BusinessEntities.QualificationDetails();

                    Label QualificationValue = (Label)gvQualification.Rows[i].FindControl(QUALIFICATION);
                    Label QualificationId    = (Label)gvQualification.Rows[i].FindControl(QUALIFICATIONID);
                    Label Mode = (Label)gvQualification.Rows[i].FindControl(MODE);

                    objQualificationDetails.QualificationId   = int.Parse(QualificationId.Text);
                    objQualificationDetails.EMPId             = int.Parse(EMPId.Value);
                    objQualificationDetails.QualificationName = gvQualification.Rows[i].Cells[0].Text;
                    objQualificationDetails.UniversityName    = gvQualification.Rows[i].Cells[1].Text;
                    objQualificationDetails.InstituteName     = gvQualification.Rows[i].Cells[2].Text;
                    objQualificationDetails.PassingYear       = gvQualification.Rows[i].Cells[3].Text;
                    objQualificationDetails.GPA           = float.Parse(gvQualification.Rows[i].Cells[4].Text);
                    objQualificationDetails.Outof         = float.Parse(gvQualification.Rows[i].Cells[5].Text);
                    objQualificationDetails.Percentage    = float.Parse(gvQualification.Rows[i].Cells[6].Text);
                    objQualificationDetails.Mode          = int.Parse(Mode.Text);
                    objQualificationDetails.Qualification = int.Parse(QualificationValue.Text);

                    objSaveQualificationDetailsCollection.Add(objQualificationDetails);
                }
            }
            BusinessEntities.RaveHRCollection objDeleteQualificationDetailsCollection = (BusinessEntities.RaveHRCollection)ViewState[QUALIFICATIONDETAILSDELETE];

            if (objDeleteQualificationDetailsCollection != null)
            {
                BusinessEntities.QualificationDetails obj = null;

                for (int i = 0; i < objDeleteQualificationDetailsCollection.Count; i++)
                {
                    objQualificationDetails = new BusinessEntities.QualificationDetails();
                    obj = (BusinessEntities.QualificationDetails)objDeleteQualificationDetailsCollection.Item(i);

                    objQualificationDetails.QualificationId   = obj.QualificationId;
                    objQualificationDetails.EMPId             = obj.EMPId;
                    objQualificationDetails.QualificationName = obj.QualificationName;
                    objQualificationDetails.UniversityName    = obj.UniversityName;
                    objQualificationDetails.InstituteName     = obj.InstituteName;
                    objQualificationDetails.PassingYear       = obj.PassingYear;
                    objQualificationDetails.GPA           = obj.GPA;
                    objQualificationDetails.Outof         = obj.Outof;
                    objQualificationDetails.Percentage    = obj.Percentage;
                    objQualificationDetails.Mode          = obj.Mode;
                    objQualificationDetails.Qualification = obj.Qualification;

                    objSaveQualificationDetailsCollection.Add(objQualificationDetails);
                }
            }
            objQualificationDetailsBAL.Manipulation(objSaveQualificationDetailsCollection);

            if (ViewState.Count > 0)
            {
                ViewState.Clear();
            }

            if (EMPId.Value != string.Empty)
            {
                int empID = Convert.ToInt32(EMPId.Value);
                //Refresh the grip after saving
                this.PopulateGrid(empID);
            }

            if (gvQualification.Rows[0].Cells[0].Text == NO_RECORDS_FOUND_MESSAGE)
            {
                btnSave.Visible = false;
            }


            lblMessage.Text = "Qualification details saved successfully.";
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "btnSave_Click", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }