Ejemplo n.º 1
0
        public List <OpportunityType> GetAllOpportunityTypes()
        {
            try
            {
                List <OpportunityType> listOpportunityTypes = new List <OpportunityType>();
                OpportunityType        opportunityType      = null;

                var read = _repositoryConncetion.SearchCommand("GetAllOpportunityTypes", parameters);

                DataTable dataTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dataTable.Rows)
                {
                    opportunityType = new OpportunityType();

                    opportunityType.OpportunityTypeId     = Convert.ToInt32(row["OpportunityTypeId"]);
                    opportunityType.OpportunityName       = row["OpportunityName"].ToString();
                    opportunityType.DateRegister          = Convert.ToDateTime(row["DateRegister"]);
                    opportunityType.OpportunityTypeStatus = Convert.ToBoolean(row["OpportunityTypeStatus"]);

                    listOpportunityTypes.Add(opportunityType);
                }
                return(listOpportunityTypes);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <ProfessionalLevel> GetAllProfessionalLevels()
        {
            try
            {
                List <ProfessionalLevel> listProfessionalLevels = new List <ProfessionalLevel>();
                ProfessionalLevel        professionalLevel      = null;

                var read = _repositoryConnection.SearchCommand("GetAllProfessionalLevels", parameters);

                DataTable dataTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dataTable.Rows)
                {
                    professionalLevel = new ProfessionalLevel();

                    professionalLevel.ProfessionalLevelId      = Convert.ToInt32(row["ProfessionalLevelId"]);
                    professionalLevel.ProfessionalLevelName    = row["ProfessionalLevelName"].ToString();
                    professionalLevel.ProfessionalLevelSection = Convert.ToInt32(row["ProfessionalLevelSection"]);
                    professionalLevel.DateRegister             = Convert.ToDateTime(row["DateRegister"]);
                    professionalLevel.ProfessionalLevelStatus  = Convert.ToBoolean(row["ProfessionalLevelStatus"]);

                    listProfessionalLevels.Add(professionalLevel);
                }
                return(listProfessionalLevels);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public List <Career> GetAllCareers()
        {
            try
            {
                List <Career> listCareers = new List <Career>();
                Career        career      = null;

                var read = _repositoryConnection.SearchCommand("GetAllCareers", parameters);

                DataTable dataTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dataTable.Rows)
                {
                    career = new Career();

                    career.CareerId     = Convert.ToInt32(row["CareerId"]);
                    career.CareerName   = row["CareerName"].ToString();
                    career.DateRegister = Convert.ToDateTime(row["DateRegister"]);
                    career.CareerStatus = Convert.ToBoolean(row["CareerStatus"]);

                    listCareers.Add(career);
                }
                return(listCareers);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        public List <Service> GetAllServices()
        {
            try
            {
                List <Service> listServices = new List <Service>();
                Service        service      = null;

                var read = _repositoryConnection.SearchCommand("GetAllServices", parameters);

                DataTable dateTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dateTable.Rows)
                {
                    service = new Service();

                    service.ServiceId     = Convert.ToInt32(row["ServiceId"]);
                    service.ServiceName   = row["ServiceName"].ToString();
                    service.DateRegister  = Convert.ToDateTime(row["DateRegister"]);
                    service.ServiceStatus = Convert.ToBoolean(row["ServiceStatus"]);

                    listServices.Add(service);
                }
                return(listServices);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public List <Opportunity> GetAllOpportunities()
        {
            try
            {
                List <Opportunity> listOpportunities = new List <Opportunity>();
                Opportunity        opportunity       = null;

                var read = _repositoryConnection.SearchCommand("GetAllOpportunities", parameters);

                DataTable dataTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dataTable.Rows)
                {
                    opportunity = new Opportunity();

                    opportunity.OpportunityId           = Convert.ToInt32(row["OpportunityId"]);
                    opportunity.OpportunityName         = row["OpportunityName"].ToString();
                    opportunity.OpportunityRequirements = row["OpportunityRequirements"].ToString();
                    opportunity.DesirableRequirements   = row["DesirableRequirements"].ToString();
                    opportunity.DateRegister            = Convert.ToDateTime(row["DateRegister"]);
                    opportunity.ClosingDate             = Convert.ToDateTime(row["ClosingDate"]);
                    opportunity.CancellationDate        = Convert.ToDateTime(row["CancellationDate"]);
                    opportunity.OpportunityStatus       = Convert.ToBoolean(row["OpportunityStatus"]);

                    opportunity.Career          = new Career();
                    opportunity.Career.CareerId = Convert.ToInt32(row["CareerId"]);
                    opportunity.Career          = _careerRepository.GetCareerById(opportunity.Career.CareerId);

                    opportunity.Service           = new Service();
                    opportunity.Service.ServiceId = Convert.ToInt32(row["ServiceId"]);
                    opportunity.Service           = _serviceRepository.GetServiceById(opportunity.Service.ServiceId);

                    opportunity.ProfessionalLevel = new ProfessionalLevel();
                    opportunity.ProfessionalLevel.ProfessionalLevelId = Convert.ToInt32(row["ProfessionalLevelId"]);
                    opportunity.ProfessionalLevel = _professionalLevelRepository.GetProfessionalLevelById(opportunity.ProfessionalLevel.ProfessionalLevelId);

                    opportunity.OpportunityType = new OpportunityType();
                    opportunity.OpportunityType.OpportunityTypeId = Convert.ToInt32(row["OpportunityTypeId"]);
                    opportunity.OpportunityType = _opportunityTypeRepository.GetOpportunityTypeById(opportunity.OpportunityType.OpportunityTypeId);

                    listOpportunities.Add(opportunity);
                }
                return(listOpportunities);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
        public List <VacationOpportunity> GetAllVacationOpportunities()
        {
            try
            {
                List <VacationOpportunity> listVacationOpportunities = new List <VacationOpportunity>();
                VacationOpportunity        vacationOpportunity       = null;

                var read = _repositoryConnection.SearchCommand("GetAllVacationOpportunities", parameters);

                DataTable dataTable = JsonConvert.DeserializeObject <DataTable>(read);

                foreach (DataRow row in dataTable.Rows)
                {
                    vacationOpportunity = new VacationOpportunity();

                    vacationOpportunity.VacationOpportunityId     = Convert.ToInt32(row["VacationOpportunityId"]);
                    vacationOpportunity.VacationOpeningNumber     = row["VacationOpeningNumber"].ToString();
                    vacationOpportunity.VacationOpeningDate       = Convert.ToDateTime(row["VacationOpeningDate"]);
                    vacationOpportunity.VacationOfferLetterDate   = Convert.ToDateTime(row["VacationOfferLetterDate"]);
                    vacationOpportunity.VacationLeader            = row["VacationLeader"].ToString();
                    vacationOpportunity.VacationCancellationDate  = Convert.ToDateTime(row["VacationCancellationDate"]);
                    vacationOpportunity.VacationOpportunityStatus = Convert.ToBoolean(row["VacationOpportunityStatus"]);

                    vacationOpportunity.Career          = new Career();
                    vacationOpportunity.Career.CareerId = Convert.ToInt32(row["CareerId"]);
                    vacationOpportunity.Career          = _careerRepository.GetCareerById(vacationOpportunity.Career.CareerId);

                    vacationOpportunity.ProfessionalLevel = new ProfessionalLevel();
                    vacationOpportunity.ProfessionalLevel.ProfessionalLevelId = Convert.ToInt32(row["ProfessionalLevelId"]);
                    vacationOpportunity.ProfessionalLevel = _professionalLevelRepository.GetProfessionalLevelById(vacationOpportunity.ProfessionalLevel.ProfessionalLevelId);

                    vacationOpportunity.OpportunityType = new OpportunityType();
                    vacationOpportunity.OpportunityType.OpportunityTypeId = Convert.ToInt32(row["OpportunityTypeId"]);
                    vacationOpportunity.OpportunityType = _opportunityTypeRepository.GetOpportunityTypeById(vacationOpportunity.OpportunityType.OpportunityTypeId);

                    listVacationOpportunities.Add(vacationOpportunity);
                }
                return(listVacationOpportunities);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }