/// <summary> /// Manipulations the specified obj certification details list. /// </summary> /// <param name="objCertificationDetailsList">The obj certification details list.</param> public void Manipulation(BusinessEntities.RaveHRCollection objCertificationDetailsCollection) { try { //Check for each each entry in CertificationDetails List foreach (BusinessEntities.CertificationDetails objAddCertificationDetails in objCertificationDetailsCollection) { //If mode of the entry is Add i.e. 1 then call Add() if (objAddCertificationDetails.Mode == 1) { this.AddCertificationDetails(objAddCertificationDetails); } //If mode of the entry is Update i.e. 2 then call Update() if (objAddCertificationDetails.Mode == 2) { this.UpdateCertificationDetails(objAddCertificationDetails); } //If CertificationId is greater than zero i.e. Certification is already added and mode of the entry is Delete i.e. 3 then call Delete() if (objAddCertificationDetails.Mode == 3) { this.DeleteCertificationDetails(objAddCertificationDetails); } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, MANIPULATION, EventIDConstants.RAVE_HR_EMPLOYEE_BUSNIESS_LAYER); } }
/// <summary> /// Manipulates the specified obj qualification details list. /// </summary> /// <param name="objEmergencyContactList">The obj qualification details list.</param> public void Manipulation(BusinessEntities.RaveHRCollection objEmergencyContactCollection) { try { //Check for each each entry in EmergencyContact List foreach (BusinessEntities.EmergencyContact objAddEmergencyContact in objEmergencyContactCollection) { //If mode of the entry is Add i.e. 1 then call Add() if (objAddEmergencyContact.Mode == 1) { this.AddEmergencyContact(objAddEmergencyContact); } //If mode of the entry is Update i.e. 2 then call Update() if (objAddEmergencyContact.Mode == 2) { this.UpdateEmergencyContact(objAddEmergencyContact); } //If QualificationId is greater than zero i.e. qualification is already added and mode of the entry is Delete i.e. 3 then call Delete() if (objAddEmergencyContact.EmergencyContactId > 0 && objAddEmergencyContact.Mode == 3) { this.DeleteEmergencyContact(objAddEmergencyContact); } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, MANIPULATION, EventIDConstants.RAVE_HR_EMPLOYEE_BUSNIESS_LAYER); } }
/// <summary> /// Manipulations the specified obj skills details list. /// </summary> /// <param name="objSkillsDetailsList">The obj skills details list.</param> public void Manipulation(BusinessEntities.RaveHRCollection SkillsDetailsCollection) { try { //Check for each each entry in SkillsDetails List foreach (BusinessEntities.SkillsDetails objAddSkillsDetails in SkillsDetailsCollection) { //If mode of the entry is Add i.e. 1 then call Add() if (objAddSkillsDetails.Mode == 1) { this.AddSkillsDetails(objAddSkillsDetails); } //If mode of the entry is Update i.e. 2 then call Update() if (objAddSkillsDetails.Mode == 2) { this.UpdateSkillsDetails(objAddSkillsDetails); } //If SkillId is greater than zero i.e. Skills is already added and mode of the entry is Delete i.e. 3 then call Delete() if (objAddSkillsDetails.Mode == 3) { this.DeleteSkillsDetails(objAddSkillsDetails); } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, MANIPULATION, EventIDConstants.RAVE_EMP_SKILL_SEARCH_BUSINESS_ACCESS_LAYER); } }
/// <summary> /// Gets the relevant experience. /// </summary> /// <param name="objGetOrganisationDetails">The obj get organisation details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetRelevantExperience(BusinessEntities.OrganisationDetails objGetOrganisationDetails) { // Initialise Data Access Class object objDA = new DataAccessClass(); sqlParam = new SqlParameter[1]; // Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetOrganisationDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetOrganisationDetails.EMPId; } //Execute the SP objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetRelevantExperience, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objOrganisationDetails = new BusinessEntities.OrganisationDetails(); objOrganisationDetails.ExperienceMonth = objDataReader[DbTableColumn.ExperienceInMonth].ToString() == string.Empty ? 0: int.Parse(objDataReader[DbTableColumn.ExperienceInMonth].ToString()); objOrganisationDetails.ExperienceYear = objDataReader[DbTableColumn.ExperienceInYear].ToString() == string.Empty ? 0: int.Parse(objDataReader[DbTableColumn.ExperienceInYear].ToString()); // Add the object to Collection raveHRCollection.Add(objOrganisationDetails); } // Return the Collection return(raveHRCollection); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, "GetRelevantExperience", EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } }
/// <summary> /// Manipulations the specified obj organisation details list. /// </summary> /// <param name="objOrganisationDetailsList">The obj organisation details list.</param> public void Manipulation(BusinessEntities.RaveHRCollection OrganisationDetailsCollection) { try { foreach (BusinessEntities.OrganisationDetails objAddOrganisationDetails in OrganisationDetailsCollection) { if (objAddOrganisationDetails.Mode == 1) { this.AddOrganisationDetails(objAddOrganisationDetails); } if (objAddOrganisationDetails.Mode == 2) { this.UpdateOrganisationDetails(objAddOrganisationDetails); } if (objAddOrganisationDetails.Mode == 3) { this.DeleteOrganisationDetails(objAddOrganisationDetails); } } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, MANIPULATION, EventIDConstants.RAVE_HR_EMPLOYEE_BUSNIESS_LAYER); } }
/// <summary> /// Manipulations the specified obj visa details list. /// </summary> /// <param name="objVisaDetailsList">The obj visa details list.</param> public void Manipulation(BusinessEntities.RaveHRCollection objVisaDetailsCollection) { foreach (BusinessEntities.VisaDetails objAddVisaDetails in objVisaDetailsCollection) { if (objAddVisaDetails.Mode == 1) { this.AddVisaDetails(objAddVisaDetails); } if (objAddVisaDetails.Mode == 2) { this.UpdateVisaDetails(objAddVisaDetails); } if (objAddVisaDetails.Mode == 3) { this.DeleteVisaDetails(objAddVisaDetails); } } }
public BusinessEntities.RaveHRCollection GetPrimaryAndSecondarySkills() { Rave.HR.DataAccessLayer.Employees.SkillsDetails objGetSkillsDetailsDAL; try { BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection(); //Created new instance of SkillsDetails class to call GetSkillsDetails() of Data access layer objGetSkillsDetailsDAL = new Rave.HR.DataAccessLayer.Employees.SkillsDetails(); raveHRCollection = objGetSkillsDetailsDAL.GetPrimaryAndSecondarySkills(); return(raveHRCollection); } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, "GetPrimaryAndSecondarySkills", EventIDConstants.RAVE_EMP_SKILL_SEARCH_BUSINESS_ACCESS_LAYER); } }
/// <summary> /// Master data for dropDown /// </summary> /// <param name="category"></param> /// <returns>Collection</returns> public BusinessEntities.RaveHRCollection FillDropDownsBL(int EmpId) { //Object declaration of SkillsDetails class Rave.HR.DataAccessLayer.Employees.SkillsDetails objGetSkillsDetailsDAL; try { BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection(); //Created new instance of SkillsDetails class to call GetSkillsDetails() of Data access layer objGetSkillsDetailsDAL = new Rave.HR.DataAccessLayer.Employees.SkillsDetails(); raveHRCollection = objGetSkillsDetailsDAL.FillDropDownsDL(EmpId); return(raveHRCollection); } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, "FillDropDownsBL", EventIDConstants.RAVE_EMP_SKILL_SEARCH_BUSINESS_ACCESS_LAYER); } }
/// <summary> /// Adds the project details. /// </summary> /// <param name="objAddProjectDetails">The obj add project details.</param> public BusinessEntities.RaveHRCollection GetEmpResumeCountDetails(BusinessEntities.EmployeeResume objEmployeeResumeCount) { //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { objDA = new DataAccessClass(); objDA.OpenConnection(DBConstants.GetDBConnectionString()); SqlParameter[] sqlParam = new SqlParameter[1]; sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); sqlParam[0].Value = objEmployeeResumeCount.EMPId; objDataReader = objDA.ExecuteReaderSP(SPNames.USP_Employee_GetEmployeeResumeCountDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objEmployeeResumeCount = new BusinessEntities.EmployeeResume(); objEmployeeResumeCount.ResumeCount = objDataReader[DbTableColumn.ResumeCount].ToString(); // Add the object to Collection raveHRCollection.Add(objEmployeeResumeCount); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, "GetResumeDetailsCount", EventIDConstants.RAVE_HR_EMPLOYEE_DATA_ACCESS_LAYER); } finally { objDA.CloseConncetion(); } return(raveHRCollection); }
public DataTable GetSkillSearchDetails(string commaSeparatedMandatorySkills, string commadSepratedOptionalSkills, string SortExpressionAndDirection) { Rave.HR.DataAccessLayer.Employees.SkillsDetails objGetSkillsDetailsDAL; try { BusinessEntities.SkillSearch objSkillSearch = new BusinessEntities.SkillSearch(); BusinessEntities.RaveHRCollection raveHRCollection = new BusinessEntities.RaveHRCollection(); objSkillSearch.MandatorySkills = commaSeparatedMandatorySkills; objSkillSearch.OptionalSkills = commadSepratedOptionalSkills; objGetSkillsDetailsDAL = new Rave.HR.DataAccessLayer.Employees.SkillsDetails(); //Siddharth 27 March 2015 Start return(objGetSkillsDetailsDAL.GetSkillSearchDetails(objSkillSearch, SortExpressionAndDirection)); //Siddharth 27 March 2015 End //return raveHRCollection; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, CLASS_NAME, "GetSkillSearchDetails", EventIDConstants.RAVE_EMP_SKILL_SEARCH_BUSINESS_ACCESS_LAYER); } }
/// <summary> /// Adds the project details. /// </summary> /// <param name="objAddProjectDetails">The obj add project details.</param> public BusinessEntities.RaveHRCollection AddEmpResumeDetails(BusinessEntities.EmployeeResume objEmployeeResume) { //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { objDA = new DataAccessClass(); objDA.OpenConnection(DBConstants.GetDBConnectionString()); SqlParameter[] sqlParam = new SqlParameter[5]; sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); sqlParam[0].Value = objEmployeeResume.EMPId; sqlParam[1] = new SqlParameter(SPParameter.DocumentName, SqlDbType.NVarChar, 50); if (objEmployeeResume.DocumentName == "" || objEmployeeResume.DocumentName == null) { sqlParam[1].Value = DBNull.Value; } else { sqlParam[1].Value = objEmployeeResume.DocumentName; } sqlParam[2] = new SqlParameter(SPParameter.ModifyDate, SqlDbType.SmallDateTime); if (objEmployeeResume.ModifyDate == DateTime.MinValue || objEmployeeResume.ModifyDate == null) { sqlParam[2].Value = DBNull.Value; } else { sqlParam[2].Value = objEmployeeResume.ModifyDate; } sqlParam[3] = new SqlParameter(SPParameter.ModifyBy, SqlDbType.NVarChar, 50); if (objEmployeeResume.ModifyBy == "" || objEmployeeResume.ModifyBy == null) { sqlParam[3].Value = DBNull.Value; } else { sqlParam[3].Value = objEmployeeResume.ModifyBy; } sqlParam[4] = new SqlParameter(SPParameter.FileExtension, SqlDbType.NVarChar, 50); if (objEmployeeResume.FileExtension == string.Empty || objEmployeeResume.FileExtension == null) { sqlParam[4].Value = DBNull.Value; } else { sqlParam[4].Value = objEmployeeResume.FileExtension; } objDataReader = objDA.ExecuteReaderSP(SPNames.USP_Employee_AddEmployeeResumeDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objEmployeeResume = new BusinessEntities.EmployeeResume(); objEmployeeResume.ResumeCount = objDataReader[DbTableColumn.ResumeCount].ToString(); // Add the object to Collection raveHRCollection.Add(objEmployeeResume); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, "AddResumeDetails", EventIDConstants.RAVE_HR_EMPLOYEE_DATA_ACCESS_LAYER); } finally { objDA.CloseConncetion(); } return(raveHRCollection); }
/// <summary> /// Gets the Employee Resume details. /// </summary> /// <param name="objGetCertificationDetails">The object get Employee Resume details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetEmployeeResumeDetails(BusinessEntities.EmployeeResume objGetEmployeeResumeDetails) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetEmployeeResumeDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetEmployeeResumeDetails.EMPId; } objDataReader = objDA.ExecuteReaderSP(SPNames.USP_Employee_GetEmployeeResumeDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objGetEmployeeResumeDetails = new BusinessEntities.EmployeeResume(); objGetEmployeeResumeDetails.ResumeId = Convert.ToInt32(objDataReader[DbTableColumn.ResumeId].ToString()); objGetEmployeeResumeDetails.EMPId = Convert.ToInt32(objDataReader[DbTableColumn.EMPId].ToString()); objGetEmployeeResumeDetails.DocumentName = objDataReader[DbTableColumn.DocumentName].ToString(); objGetEmployeeResumeDetails.ModifyDate = Convert.ToDateTime(objDataReader[DbTableColumn.ModifyDate].ToString()); objGetEmployeeResumeDetails.ModifyBy = objDataReader[DbTableColumn.ModifyBy].ToString(); objGetEmployeeResumeDetails.FileExtension = objDataReader[DbTableColumn.FileExtension].ToString(); // Add the object to Collection raveHRCollection.Add(objGetEmployeeResumeDetails); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, GETEMPLOYEERESUMEETAILS, EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }
/// <summary> /// Gets the visa details. /// </summary> /// <param name="objGetVisaDetails">The obj get visa details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetVisaDetails(BusinessEntities.VisaDetails objGetVisaDetails) { // Initialise Data Access Class object objDA = new DataAccessClass(); sqlParam = new SqlParameter[1]; // Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetVisaDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetVisaDetails.EMPId; } //Execute the SP objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetVisaDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objVisaDetails = new BusinessEntities.VisaDetails(); objVisaDetails.VisaId = int.Parse(objDataReader[DbTableColumn.VisaId].ToString()); objVisaDetails.EMPId = int.Parse(objDataReader[DbTableColumn.EMPId].ToString()); objVisaDetails.CountryName = objDataReader[DbTableColumn.CountryName].ToString(); objVisaDetails.VisaType = objDataReader[DbTableColumn.VisaType].ToString(); objVisaDetails.ExpiryDate = Convert.ToDateTime(objDataReader[DbTableColumn.ExpiryDate].ToString()); // Add the object to Collection raveHRCollection.Add(objVisaDetails); } // Return the Collection return(raveHRCollection); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, Fn_GetProfessionalDetails, EventIDConstants.RAVE_HR_EMPLOYEE_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } }
/// <summary> /// Gets the qualification details. /// </summary> /// <param name="objGetContactDetails">The object get qualification details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetContactDetails(BusinessEntities.ContactDetails objGetContactDetails) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetContactDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetContactDetails.EMPId; } objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetContact, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objContactDetails = new BusinessEntities.ContactDetails(); objContactDetails.EmployeeContactId = Convert.ToInt32(objDataReader[DbTableColumn.EmpContactId].ToString()); objContactDetails.EMPId = Convert.ToInt32(objDataReader[DbTableColumn.EMPId].ToString()); objContactDetails.CityCode = objDataReader[DbTableColumn.CityCode].ToString() == string.Empty ? 0 : int.Parse(objDataReader[DbTableColumn.CityCode].ToString()); objContactDetails.CountryCode = objDataReader[DbTableColumn.CountryCode].ToString() == string.Empty ? 0: int.Parse(objDataReader[DbTableColumn.CountryCode].ToString()); objContactDetails.ContactNo = objDataReader[DbTableColumn.ContactNo].ToString().Trim(); objContactDetails.Extension = objDataReader[DbTableColumn.Extension].ToString() == string.Empty ? 0 : int.Parse(objDataReader[DbTableColumn.Extension].ToString()); objContactDetails.AvalibilityTime = objDataReader[DbTableColumn.AvalibilityTime].ToString().Trim(); objContactDetails.ContactType = int.Parse(objDataReader[DbTableColumn.ContactType].ToString()); //objContactDetails.IsActive = Convert.ToBoolean(objDataReader[DbTableColumn.IsActive].ToString()); objContactDetails.ContactTypeName = objDataReader[DbTableColumn.ContactTypeName].ToString().Trim(); // Add the object to Collection raveHRCollection.Add(objContactDetails); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, GETCONTACTDETAILS, EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }
/// <summary> /// Gets the qualification details. /// </summary> /// <param name="objGetQualificationDetails">The object get qualification details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetQualificationDetails(BusinessEntities.QualificationDetails objGetQualificationDetails) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetQualificationDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetQualificationDetails.EMPId; } objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetQualificationDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objQualificationDetails = new BusinessEntities.QualificationDetails(); objQualificationDetails.QualificationId = Convert.ToInt32(objDataReader[DbTableColumn.QId].ToString()); objQualificationDetails.EMPId = Convert.ToInt32(objDataReader[DbTableColumn.EMPId].ToString()); objQualificationDetails.QualificationName = objDataReader[DbTableColumn.Qualification].ToString(); objQualificationDetails.UniversityName = objDataReader[DbTableColumn.UniversityName].ToString(); objQualificationDetails.InstituteName = objDataReader[DbTableColumn.InstitutionName].ToString(); objQualificationDetails.PassingYear = objDataReader[DbTableColumn.PassingYear].ToString(); objQualificationDetails.Percentage = objDataReader[DbTableColumn.Percentage].ToString() == string.Empty ? 0 : float.Parse(objDataReader[DbTableColumn.Percentage].ToString()); objQualificationDetails.GPA = objDataReader[DbTableColumn.GPA].ToString() == string.Empty ? 0 : float.Parse(objDataReader[DbTableColumn.GPA].ToString()); objQualificationDetails.Outof = objDataReader[DbTableColumn.OutOf].ToString() == string.Empty ? 0 : float.Parse(objDataReader[DbTableColumn.OutOf].ToString()); objQualificationDetails.Qualification = int.Parse(objDataReader[DbTableColumn.QualificationId].ToString()); objQualificationDetails.Stream = objDataReader[DbTableColumn.Stream].ToString(); // Add the object to Collection raveHRCollection.Add(objQualificationDetails); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, GETQUALIFICATIONDETAILS, EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }
/// <summary> /// Gets the project details. /// </summary> /// <param name="objGetProjectDetails">The obj get project details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetProjectDetails(BusinessEntities.ProjectDetails objGetProjectDetails) { // Initialise Data Access Class object objDA = new DataAccessClass(); sqlParam = new SqlParameter[1]; // Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetProjectDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetProjectDetails.EMPId; } //Execute the SP objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetProjectsDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objProjectDetails = new BusinessEntities.ProjectDetails(); objProjectDetails.ProjectId = int.Parse(objDataReader[DbTableColumn.PId].ToString()); objProjectDetails.EMPId = int.Parse(objDataReader[DbTableColumn.EMPId].ToString()); objProjectDetails.ProjectName = objDataReader[DbTableColumn.ProjectName].ToString(); objProjectDetails.Organisation = objDataReader[DbTableColumn.Organisation].ToString(); objProjectDetails.Years = objDataReader[DbTableColumn.Years].ToString(); objProjectDetails.Role = objDataReader[DbTableColumn.Role].ToString(); objProjectDetails.Onsite = Convert.ToBoolean(objDataReader[DbTableColumn.Onsite].ToString()); objProjectDetails.OnsiteDuration = objDataReader[DbTableColumn.OnsiteDuration].ToString(); objProjectDetails.Description = objDataReader[DbTableColumn.Description].ToString(); objProjectDetails.LocationId = int.Parse(objDataReader[DbTableColumn.ProjectLocation].ToString()); objProjectDetails.ProjectLocation = objDataReader[DbTableColumn.LocationName].ToString(); objProjectDetails.ProjectSize = int.Parse(objDataReader[DbTableColumn.ProjectSize].ToString()); objProjectDetails.ClientName = objDataReader[DbTableColumn.ClientName].ToString(); objProjectDetails.Resposibility = objDataReader[DbTableColumn.Resposibility].ToString(); objProjectDetails.ProjectDone = int.Parse(objDataReader[DbTableColumn.ProjectDone].ToString()); objProjectDetails.ProjectDoneName = objDataReader[DbTableColumn.ProjectDoneName].ToString(); if (!string.IsNullOrEmpty(objDataReader[DbTableColumn.RankOrder].ToString())) { objProjectDetails.RankOrder = int.Parse(objDataReader[DbTableColumn.RankOrder].ToString()); } // Add the object to Collection raveHRCollection.Add(objProjectDetails); } // Return the Collection return(raveHRCollection); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, "GetProfessionalDetails", EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } }
/// <summary> /// Gets the organisation details. /// </summary> /// <param name="objGetOrganisationDetails">The obj get organisation details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetOrganisationDetails(BusinessEntities.OrganisationDetails objGetOrganisationDetails) { // Initialise Data Access Class object objDA = new DataAccessClass(); sqlParam = new SqlParameter[2]; // Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetOrganisationDetails.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetOrganisationDetails.EMPId; } sqlParam[1] = new SqlParameter(SPParameter.ExperienceType, SqlDbType.Int); if (objGetOrganisationDetails.ExperienceType == 0) { sqlParam[1].Value = DBNull.Value; } else { sqlParam[1].Value = objGetOrganisationDetails.ExperienceType; } //Execute the SP objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetOrganisationDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objOrganisationDetails = new BusinessEntities.OrganisationDetails(); objOrganisationDetails.OrganisationId = int.Parse(objDataReader[DbTableColumn.OId].ToString()); objOrganisationDetails.EMPId = int.Parse(objDataReader[DbTableColumn.EMPId].ToString()); objOrganisationDetails.CompanyName = objDataReader[DbTableColumn.CompanyName].ToString(); objOrganisationDetails.MonthSince = int.Parse(objDataReader[DbTableColumn.MonthSince].ToString()); objOrganisationDetails.YearSince = int.Parse(objDataReader[DbTableColumn.YearSince].ToString()); objOrganisationDetails.MonthTill = int.Parse(objDataReader[DbTableColumn.MonthTill].ToString()); objOrganisationDetails.YearTill = int.Parse(objDataReader[DbTableColumn.YearTill].ToString()); objOrganisationDetails.Designation = objDataReader[DbTableColumn.Designation].ToString(); objOrganisationDetails.MonthSinceName = objDataReader[DbTableColumn.MonthSinceName].ToString(); objOrganisationDetails.MonthTillName = objDataReader[DbTableColumn.MonthTillName].ToString(); objOrganisationDetails.WorkingSince = objOrganisationDetails.MonthSinceName + "-" + objOrganisationDetails.YearSince.ToString(); objOrganisationDetails.WorkingTill = objOrganisationDetails.MonthTillName + "-" + objOrganisationDetails.YearTill.ToString(); objOrganisationDetails.ExperienceMonth = objDataReader[DbTableColumn.ExperienceInMonth].ToString() == string.Empty ? 0 : int.Parse(objDataReader[DbTableColumn.ExperienceInMonth].ToString()); objOrganisationDetails.ExperienceYear = objDataReader[DbTableColumn.ExperienceInYear].ToString() == string.Empty ? 0 : int.Parse(objDataReader[DbTableColumn.ExperienceInYear].ToString()); objOrganisationDetails.Experience = objOrganisationDetails.ExperienceYear + " " + YEARS + "-" + objOrganisationDetails.ExperienceMonth + " " + MONTHS; // Add the object to Collection raveHRCollection.Add(objOrganisationDetails); } // Return the Collection return(raveHRCollection); } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, "GetProfessionalDetails", EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } }
/// <summary> /// Gets the Employee Address. /// </summary> /// <param name="objGetCertificationDetails">The object get certification details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetEmployeeAddress(BusinessEntities.Employee objEmployee) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { using (TransactionScope ts = new TransactionScope()) { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objEmployee.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objEmployee.EMPId; } objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetAddress, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objAddress = new BusinessEntities.Address(); objAddress.EmployeeAddressId = Convert.ToInt32(objDataReader[DbTableColumn.EmployeeAddressId].ToString()); objAddress.EMPId = Convert.ToInt32(objDataReader[DbTableColumn.EMPId].ToString()); objAddress.Addres = objDataReader[DbTableColumn.Address].ToString(); objAddress.FlatNo = objDataReader[DbTableColumn.FlatNo].ToString(); objAddress.BuildingName = objDataReader[DbTableColumn.BuildingName].ToString(); objAddress.Street = objDataReader[DbTableColumn.Street].ToString(); objAddress.Landmark = objDataReader[DbTableColumn.LandMark].ToString(); objAddress.State = objDataReader[DbTableColumn.State].ToString(); objAddress.Country = objDataReader[DbTableColumn.Country].ToString(); objAddress.City = objDataReader[DbTableColumn.City].ToString(); objAddress.Pincode = objDataReader[DbTableColumn.PinCode].ToString(); objAddress.AddressType = int.Parse(objDataReader[DbTableColumn.AddressType].ToString()); // Add the object to Collection raveHRCollection.Add(objAddress); } if (!objDataReader.IsClosed) { objDataReader.Close(); } ts.Complete(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, GETADDRESS, EventIDConstants.RAVE_HR_EMPLOYEE_DATA_ACCESS_LAYER); } finally { if (!objDataReader.IsClosed) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }
/// <summary> /// Gets the CR details. /// </summary> /// <param name="objGetCRDetails">The obj get CR details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetCRDetails(BusinessEntities.Contract objGetCRDetails) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.ContractId, SqlDbType.Int); if (objGetCRDetails.ContractID == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetCRDetails.ContractID; } objDataReader = objDA.ExecuteReaderSP(SPNames.Contracts_GetCRDetails, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objCRDetails = new BusinessEntities.Contract(); objCRDetails.CRId = Convert.ToInt32(objDataReader[DbTableColumn.Con_CRId].ToString()); objCRDetails.CRProjectCode = objDataReader[DbTableColumn.ProjectCode].ToString(); objCRDetails.CRReferenceNo = objDataReader[DbTableColumn.Con_CRReferenceNo].ToString(); objCRDetails.CRStartDate = Convert.ToDateTime(objDataReader[DbTableColumn.Con_CRStartDate].ToString()); objCRDetails.CREndDate = Convert.ToDateTime(objDataReader[DbTableColumn.Con_CREndDate].ToString()); objCRDetails.CRRemarks = objDataReader[DbTableColumn.Con_Remarks].ToString(); // Add the object to Collection raveHRCollection.Add(objCRDetails); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, Contracts, "GetCRDetails", EventIDConstants.RAVE_HR_PROJECTS_DATA_ACCESS_LAYER); } finally { if (objDataReader != null) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }
/// <summary> /// Gets the Employee Address. /// </summary> /// <param name="objGetCertificationDetails">The object get certification details.</param> /// <returns></returns> public BusinessEntities.RaveHRCollection GetEmergencyContact(BusinessEntities.EmergencyContact objGetEmergencyContact) { //Initialise Data Access Class object objDA = new DataAccessClass(); //Initialise SqlParameter Class object sqlParam = new SqlParameter[1]; //Initialise Collection class object raveHRCollection = new BusinessEntities.RaveHRCollection(); try { using (TransactionScope ts = new TransactionScope()) { //Open the connection to DB objDA.OpenConnection(DBConstants.GetDBConnectionString()); //Check each parameters nullibality and add values to sqlParam object accordingly sqlParam[0] = new SqlParameter(SPParameter.EmpId, SqlDbType.Int); if (objGetEmergencyContact.EMPId == 0) { sqlParam[0].Value = DBNull.Value; } else { sqlParam[0].Value = objGetEmergencyContact.EMPId; } objDataReader = objDA.ExecuteReaderSP(SPNames.Employee_GetEmergencyContact, sqlParam); while (objDataReader.Read()) { //Initialise the Business Entity object objEmergencyContact = new BusinessEntities.EmergencyContact(); objEmergencyContact.EmergencyContactId = Convert.ToInt32(objDataReader[DbTableColumn.EmergencyContactId].ToString()); objEmergencyContact.EMPId = Convert.ToInt32(objDataReader[DbTableColumn.EMPId].ToString()); objEmergencyContact.ContactName = objDataReader[DbTableColumn.ContactName].ToString(); objEmergencyContact.ContactNumber = objDataReader[DbTableColumn.ContactNumber].ToString(); objEmergencyContact.Relation = objDataReader[DbTableColumn.Relation].ToString(); objEmergencyContact.RelationType = int.Parse(objDataReader[DbTableColumn.RelationType].ToString()); // Add the object to Collection raveHRCollection.Add(objEmergencyContact); } if (!objDataReader.IsClosed) { objDataReader.Close(); } ts.Complete(); } } catch (RaveHRException ex) { throw ex; } catch (Exception ex) { throw new RaveHRException(ex.Message, ex, Sources.DataAccessLayer, CLASS_NAME, GETEMERGENCYCONTACT, EventIDConstants.RAVE_HR_EMPLOYEE_DATA_ACCESS_LAYER); } finally { if (!objDataReader.IsClosed) { objDataReader.Close(); } objDA.CloseConncetion(); } // Return the Collection return(raveHRCollection); }