public TRes JobFilters <TReq, TRes>(TReq request) where TReq : class, IGetJobFiltersRequest where TRes : class, IGetJobFiltersResponse
        {
            JXTNext_GetJobFiltersRequest optionsRequest = request as JXTNext_GetJobFiltersRequest;

            ConnectorGetRequest connectorRequest = new ConnectorGetRequest(HTTP_Requests_MaxWaitTime)
            {
                HeaderValues = HTTP_Request_HeaderValues,
                TargetUri    = new Uri(CONFIG_DataAccessTarget + $"/api/options/JobFilters")
            };
            ConnectorResponse response = JXTNext.Common.API.Connector.Get(connectorRequest);

            //parse the response
            bool actionSuccessful = response.Success;

            if (actionSuccessful)
            {
                dynamic responseObj = JObject.Parse(response.Response);

                return(new JXTNext_GetJobFiltersResponse {
                    Success = true, Filters = ConvertToData(responseObj)
                } as TRes);
            }
            else
            {
                return new JXTNext_GetJobFiltersResponse {
                           Success = false, Messages = new List <string> {
                               response.Response
                           }
                }
            } as TRes;
Beispiel #2
0
        public IMemberGetByIdResponse GetMemberByEmail(string email)
        {
            try
            {
                ConnectorGetRequest connectorRequest = new ConnectorGetRequest(HTTP_Requests_MaxWaitTime)
                {
                    HeaderValues = HTTP_Request_HeaderValues,
                    TargetUri    = new Uri(CONFIG_DataAccessTarget + $"/api/member/GetMemberByEmail/{email}")
                };
                ConnectorResponse response = JXTNext.Common.API.Connector.Get(connectorRequest);

                //parse the response
                bool actionSuccessful = response.Success;

                if (actionSuccessful)
                {
                    dynamic responseObj = JObject.Parse(response.Response);

                    if (responseObj["status"] == 200)
                    {
                        return new JXTNext_MemberGetByIdResponse {
                                   Success = true, Member = _memberMapper.Member_ConvertToLocalEntity <MemberModel>(responseObj)
                        }
                    }
                    ;
                    else
                    {
                        return new JXTNext_MemberGetByIdResponse {
                                   Success = false, Errors = JsonConvert.DeserializeObject <List <string> >(responseObj["errors"].ToString())
                        }
                    };
                }
                else
                {
                    return new JXTNext_MemberGetByIdResponse {
                               Success = false, Errors = new List <string> {
                                   response.Response
                               }
                    }
                };
            }
            catch (Exception ex)
            {
                return(new JXTNext_MemberGetByIdResponse {
                    Success = false, Errors = new List <string> {
                        ex.Message
                    }
                });
            }
        }
Beispiel #3
0
        public IGetJobListingResponse GuestGetJob(IGetJobListingRequest jobDetails)
        {
            JXTNext_GetJobListingRequest jobRequest = jobDetails as JXTNext_GetJobListingRequest;

            ConnectorGetRequest connectorRequest = new ConnectorGetRequest(HTTP_Requests_MaxWaitTime)
            {
                HeaderValues = HTTP_Request_HeaderValues,
                TargetUri    = new Uri(CONFIG_DataAccessTarget + $"/api/guest/job/{jobRequest.JobID}")
            };
            ConnectorResponse response = JXTNext.Common.API.Connector.Get(connectorRequest);

            //parse the response
            bool actionSuccessful = response.Success;

            if (actionSuccessful)
            {
                dynamic responseObj = JObject.Parse(response.Response);


                if (responseObj["status"] == 200)
                {
                    JObject jobItem = JObject.Parse(responseObj["data"].Value);

                    return(new JXTNext_GetJobListingResponse {
                        Success = true, Job = _jobMapper.ConvertToLocalEntity <JobDetailsFullModel>(jobItem)
                    });
                }
                else
                {
                    return new JXTNext_GetJobListingResponse {
                               Success = false, Errors = JsonConvert.DeserializeObject <List <string> >(responseObj["errors"].ToString())
                    }
                };
            }
            else
            {
                return new JXTNext_GetJobListingResponse {
                           Success = false, Errors = new List <string> {
                               response.Response
                           }
                }
            };
        }
Beispiel #4
0
        public IMemberJobAlertsResponse MemberJobAlertGet(int jobAlertId)
        {
            ConnectorGetRequest connectorRequest = new ConnectorGetRequest(HTTP_Requests_MaxWaitTime)
            {
                HeaderValues = base.HTTP_Request_HeaderValues,
                TargetUri    = new Uri(CONFIG_DataAccessTarget + $"/api/member/jobalert/{jobAlertId}")
            };
            ConnectorResponse response = JXTNext.Common.API.Connector.Get(connectorRequest);

            //parse the response
            bool actionSuccessful = response.Success;

            if (actionSuccessful)
            {
                dynamic responseObj = JObject.Parse(response.Response);

                if (responseObj["status"] == 200)
                {
                    dynamic jobAlert = JsonConvert.DeserializeObject <dynamic>(responseObj["data"].ToString());

                    return(new JXTNext_MemberJobAlertsResponse {
                        Success = true, MemberJobAlerts = jobAlert
                    });
                }
                else
                {
                    return new JXTNext_MemberJobAlertsResponse {
                               Success = false, Errors = JsonConvert.DeserializeObject <List <string> >(responseObj["errors"].ToString())
                    }
                };
            }
            else
            {
                return new JXTNext_MemberJobAlertsResponse {
                           Success = false, Errors = new List <string> {
                               response.Response
                           }
                }
            };
        }
Beispiel #5
0
        public IMemberAppliedJobResponse MemberAppliedJobsGet()
        {
            ConnectorGetRequest connectorRequest = new ConnectorGetRequest(HTTP_Requests_MaxWaitTime)
            {
                HeaderValues = base.HTTP_Request_HeaderValues,
                TargetUri    = new Uri(CONFIG_DataAccessTarget + $"/api/member/jobapplications")
            };
            ConnectorResponse response = JXTNext.Common.API.Connector.Get(connectorRequest);

            //parse the response
            bool actionSuccessful = response.Success;

            if (actionSuccessful)
            {
                dynamic responseObj = JObject.Parse(response.Response);

                if (responseObj["status"] == 200 && responseObj["data"] != null)
                {
                    return(new JXTNext_MemberAppliedJobResponse {
                        Success = true, MemberAppliedJobs = _memberMapper.MemberAppliedJob_ConvertToLocalEntity <MemberAppliedJob>(JsonConvert.DeserializeObject <dynamic>(responseObj["data"].ToString()))
                    });
                }
                else
                {
                    return new JXTNext_MemberAppliedJobResponse {
                               Success = false, Errors = JsonConvert.DeserializeObject <List <string> >(responseObj["errors"].ToString())
                    }
                };
            }
            else
            {
                return new JXTNext_MemberAppliedJobResponse {
                           Success = false, Errors = new List <string> {
                               response.Response
                           }
                }
            };
        }