コード例 #1
0
        /// <summary>
        /// Gets the Project Search results based on search criteria
        /// </summary>
        /// <returns>List</returns>
        public List <BusinessEntities.Projects> GetProjectSearchResult(string strKeyword)
        {
            try
            {
                List <BusinessEntities.Projects>          objListRetrieveProjectDetails = new List <BusinessEntities.Projects>();
                Rave.HR.DataAccessLayer.Projects.Projects objRetrieveProjectDAL         = new Rave.HR.DataAccessLayer.Projects.Projects();

                BusinessEntities.Projects objRaveHR = null;

                DataSet dsRetrieveProjectDetails = new DataSet();
                dsRetrieveProjectDetails = objRetrieveProjectDAL.GetProjectSearchResult(strKeyword);

                foreach (DataRow drRetrieveProjectDetails in dsRetrieveProjectDetails.Tables[0].Rows)
                {
                    objRaveHR                  = new BusinessEntities.Projects();
                    objRaveHR.ID               = int.Parse(drRetrieveProjectDetails["ProjectID"].ToString());
                    objRaveHR.ClientName       = drRetrieveProjectDetails["ClientName"].ToString();
                    objRaveHR.ProjectName      = drRetrieveProjectDetails["ProjectName"].ToString();
                    objRaveHR.Location         = drRetrieveProjectDetails["Location"].ToString();
                    objRaveHR.Category         = drRetrieveProjectDetails["Category"].ToString();
                    objRaveHR.TechnologyName   = drRetrieveProjectDetails["TechnologyName"].ToString();
                    objRaveHR.StartDate        = DateTime.Parse(drRetrieveProjectDetails["StartDate"].ToString());
                    objRaveHR.EndDate          = DateTime.Parse(drRetrieveProjectDetails["EndDate"].ToString());
                    objRaveHR.ProjectStartYear = int.Parse(drRetrieveProjectDetails["StartYear"].ToString());
                    objRaveHR.ProjectEndYear   = int.Parse(drRetrieveProjectDetails["EndYear"].ToString());

                    objListRetrieveProjectDetails.Add(objRaveHR);
                }
                return(objListRetrieveProjectDetails);
            }
            catch (RaveHRException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new RaveHRException(ex.Message, ex, Sources.BusinessLayer, "RaveHRProjects.cs", "GetProjectSearchResult", EventIDConstants.RAVE_HR_PROJECTS_BUSNIESS_LAYER);
            }
        }