Пример #1
0
        internal static IEnumerable <JobDetailedViewModel> GetDetailedMyJobsList()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;

            var jobsList =
                HttpRequester.Get <IEnumerable <JobDetailedModel> >(BaseServicesUrl + "jobs/current-jobs", headers);

            return(jobsList.
                   AsQueryable().
                   Select(model => new JobDetailedViewModel()
            {
                Id = model.Id,
                Title = model.Title,
                Description = model.Description,
                Deadline = model.Deadline,
                CreatedAt = model.CreatedAt,
                Completed = model.Completed,
                Price = model.Price,
                //Tasks = model.Tasks.AsQueryable().Select(todo => new TaskViewModel()
                //{
                //    Id = todo.Id,
                //    Name = todo.Name,
                //    Pending = todo.Pending
                //}).ToList(),
                //Tasks = model.Tasks,
                Owner = model.Owner,
                TotalDifficulty = model.TotalDifficulty,
                Category = model.Category,
                //JobTags = model.JobTags.AsQueryable().Select(tag => tag.Name).ToList()
                // JobTags = model.JobTags
            }));
        }
Пример #2
0
        internal static IEnumerable <JobDetailedViewModel> SearchJob(string queryString)
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;

            var matchedJobs =
                HttpRequester.Get <IEnumerable <JobDetailedModel> >(BaseServicesUrl + "jobs/search?query=" + queryString, headers);

            return(matchedJobs.
                   AsQueryable().
                   Select(model => new JobDetailedViewModel()
            {
                Id = model.Id,
                Title = model.Title,
                Description = model.Description,
                //Deadline = model.Deadline,
                //CreatedAt = model.CreatedAt,
                //Completed = model.Completed,
                //Price = model.Price,
                //Tasks = model.Tasks.AsQueryable().Select(todo => new TaskViewModel()
                //{
                //    Id = todo.Id,
                //    Name = todo.Name,
                //    Pending = todo.Pending
                //}).ToList(),
                ////Tasks = model.Tasks,
                //TotalDifficulty = model.TotalDifficulty,
                //Category = model.Category,
                //JobTags = model.JobTags.AsQueryable().Select(tag => tag.Name).ToList()
            }));
        }
Пример #3
0
        internal static IEnumerable <JobDetailedViewModel> GetMyJobsList()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;

            var jobsList =
                HttpRequester.Get <IEnumerable <JobDetailedViewModel> >(BaseServicesUrl + "jobs/current-jobs-names", headers);

            return(jobsList.
                   AsQueryable().
                   Select(model => new JobDetailedViewModel()
            {
                Id = model.Id,
                Title = model.Title,
            }));
        }