public List <IRecruitmentRequest> getRecruitmentRequests(int recruitmentRequestID) { recruitmentRequestList.Clear(); SqlConnection conn = DBUtility.GetConnection(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_getSelectedRecruitmentRequestDetails_667961"; cmd.Parameters.AddWithValue("@RecruitmentRequestID", recruitmentRequestID); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); int flag = 0; while (reader.Read()) { flag = 1; int recruitmentRequestId = reader.GetInt32(0); DateTime requiredByDate = reader.GetDateTime(1); int placementConsultantID = reader.GetInt32(2); IRecruitmentRequest recruitmentRequest = RecruitmentRequestFactory.CreateRecruitmentRequest(); recruitmentRequest.RecruitmentRequestID = recruitmentRequestId; recruitmentRequest.RequiredDate = requiredByDate; recruitmentRequest.PlacementConsultantID = placementConsultantID; recruitmentRequestList.Add(recruitmentRequest); } conn.Close(); return(recruitmentRequestList); }
//List<IRecruitmentRequest> recruitmentRequestList=new List<IRecruitmentRequest>(); //FUNCTION FOR GETTING THE LIST OF RECRUITMENTS public List <IRecruitmentRequest> SelectingRecruitmentRequest() { recruitmentRequestList.Clear(); SqlConnection conn = DBUtility.GetConnection(); vacancyList.Clear(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_SelectingRecruitmentRequest_667961"; conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); int flag = 0; while (reader.Read()) { flag = 1; int recruitmentRequestId = reader.GetInt32(0); DateTime requiredByDate = reader.GetDateTime(1); int placementConsultantID = reader.GetInt32(2); IRecruitmentRequest recruitmentRequest = RecruitmentRequestFactory.CreateRecruitmentRequest(); recruitmentRequest.RecruitmentRequestID = recruitmentRequestId; recruitmentRequest.RequiredDate = requiredByDate; recruitmentRequest.PlacementConsultantID = placementConsultantID; recruitmentRequestList.Add(recruitmentRequest); } return(recruitmentRequestList); }