public static async Task <JobsDto> jobById(int Jobid)
        {
            // string MailURl = "http://localhost:62922/EmailService/";
            string functionURl = $"inventorycontrol/order/{Jobid}/jobById";
            var    _Jobs       = new JobsDto();
            string MailURl     = "https://customers.verser.com.au/AMS/";

            using (HttpClient client = new HttpClient())
            {
                client.BaseAddress = new Uri(MailURl);
                HttpResponseMessage response = client.GetAsync(string.Format(functionURl)).Result;
                if (response.IsSuccessStatusCode)
                {
                    _Jobs = await response.Content.ReadAsAsync <JobsDto>();
                }
                return(_Jobs);
            }
        }
Exemplo n.º 2
0
        public static Jobs MapClass(JobsDto dto)
        {
            Jobs jobs = new Jobs();

            jobs.githubId     = dto.id;
            jobs.type         = dto.type;
            jobs.url          = dto.url;
            jobs.created_at   = DateTime.ParseExact(dto.created_at, "ddd MMM d HH:mm:ss UTC yyyy", CultureInfo.InvariantCulture);
            jobs.company      = dto.company;
            jobs.company_url  = dto.company_url;
            jobs.location     = dto.location;
            jobs.title        = dto.title;
            jobs.description  = dto.description;
            jobs.how_to_apply = dto.how_to_apply;
            jobs.company_logo = dto.company_logo;
            jobs.JobsPage     = "Github";
            return(jobs);
        }