Exemple #1
0
        // GET: JobController
        public ActionResult Index(DateTime?date)
        {
            if (date == null)
            {
                date = DateTime.Today;
            }
            var request = new GetJobsWithDate()
            {
                Date = date
            };
            var result = mediator.Send(request).Result;
            var jobs   = result.Select(j =>
                                       new Job()
            {
                Id           = j.Id,
                Title        = j.Title,
                Status       = j.Status,
                AssigneeName = j.AssigneeName
            }
                                       );;
            var view = new JobListViewModel()
            {
                Date = (DateTime)date,
                Jobs = jobs.ToList()
            };

            return(View(view));
        }
        //SEARCH BUTTON FUNCTION
        public ActionResult Filter(string checkbox1, string checkbox2, string checkbox3, string checkbox4, string checkbox5, string checkbox6, string checkbox7, string checkbox8, string checkbox9, string priceRange, string checkbox21, string checkbox22, string checkbox23, string checkbox24, string checkbox31, string checkbox32, string checkbox33)
        {
            int salarymin = 0;
            int salarymax = 10000000;

            string[] salary = priceRange.Split('-');

            if (!string.IsNullOrEmpty(salary[0]))
            {
                salarymin = Int32.Parse(salary[0].Trim('$'));

                salarymax = Int32.Parse(salary[1].Remove(0, 2));
            }

            ;
            //compare the job type with checkboxes
            JobListViewModel jobListViewModel = new JobListViewModel
            {
                jobAds = _context.JobsAd
                         .Where(job => (job.JobRole == checkbox1 || job.JobRole == checkbox2 || job.JobRole == checkbox3 || job.JobRole == checkbox4 ||
                                        job.JobRole == checkbox5 || job.JobRole == checkbox6 || job.JobRole == checkbox7 || job.JobRole == checkbox8 ||
                                        job.JobType == checkbox21 || job.JobType == checkbox22 || job.JobType == checkbox23 || job.JobType == checkbox24 || true) && job.SalaryMin >= salarymin && job.SalaryMax <= salarymax)
                         //.Where(job=>job.SalaryMin >= salarymin || job.SalaryMax <= salarymax)
                         .ToList()
            };


            return(View("~/Views/JobList/Index.cshtml", jobListViewModel));
        }
Exemple #3
0
        public IActionResult List(string filter = "all")
        {
            IQueryable <Job> query = context.Jobs.Include(j => j.Customer);

            if (filter == "open")
            {
                query = query.Where(j => j.Status == "Open");
            }
            if (filter == "waitingOnCustomer")
            {
                query = query.Where(j => j.Status == "Waiting on Customer");
            }
            if (filter == "inProgress")
            {
                query = query.Where(j => j.Status == "In Progress");
            }
            if (filter == "closed")
            {
                query = query.Where(j => j.Status == "Closed");
            }

            List <Job> jobs = query.OrderBy(j => j.StartDate).ToList();

            JobListViewModel model = new JobListViewModel
            {
                Filter = filter,
                Jobs   = jobs
            };

            return(View(model));
        }
        public DetailViewBase(JobListViewModel jlvm)
        {
            InitializeComponent();
            VMModel model = VMModel.GetInstance();

            this.Unloaded += new RoutedEventHandler(DetailViewBase_Unloaded);
            this.Content   = jlvm.View as UserControl;
        }
Exemple #5
0
        public ActionResult Index()
        {
            var jobListViewModel = new JobListViewModel
            {
                Jobs = _jobService.GetAll()
            };

            return(View(jobListViewModel));
        }
        public IActionResult GetJobs()
        {
            JobListViewModel jobListViewModel = new JobListViewModel
            {
                Jobs = hashService.GetAllJobs()
            };

            return(PartialView(jobListViewModel));
        }
        public IActionResult Edit(int id)
        {
            var model = new JobListViewModel
            {
                Job = _jobService.GetById(id)
            };

            return(View(model));
        }
        // GET: JobList
        public ActionResult Index()
        {
            JobListViewModel jobListViewModel = new JobListViewModel
            {
                jobAds = _context.JobsAd.ToList()
            };

            return(View(jobListViewModel));
        }
        //SEARCH BUTTON FUNCTION
        public ActionResult Search(string searchstring)
        {
            JobListViewModel jobListViewModel = new JobListViewModel
            {
                jobAds = _context.JobsAd.Where(job => job.JobTitle.Contains(searchstring) || job.JobRole.Contains(searchstring) || job.JobType.Contains(searchstring) || job.CompanyName.Contains(searchstring)).ToList()
            };


            return(View("~/Views/JobList/Index.cshtml", jobListViewModel));
        }
Exemple #10
0
        public ActionResult Index(string searchingString)
        {
            JobListViewModel model = new JobListViewModel();
            var jobs = from m in _jobService.GetAll() select m;

            if (!string.IsNullOrEmpty(searchingString))
            {
                jobs = jobs.Where(x => x.Area.Contains(searchingString));
            }
            return(View(jobs.ToList()));
        }
        public IActionResult Edit(int id, string name, string term)
        {
            var model = new JobListViewModel
            {
                Job = _jobService.GetById(id)
            };

            model.Job.Name = name;
            model.Job.Term = term;
            _jobService.UpdateFromDb(model.Job);
            return(RedirectToAction("Index", "Job"));
        }
Exemple #12
0
 private void ChangeMainNode(string newName)
 {
     vmModel.Settings.MainNodeName = this.MainNodeName;
     vmModel.Settings.SaveToFile();
     ChangeMainNodeNameCommand.RaiseCanExecuteChanged();
     if (vmModel.ActiveVMList.Count > 0)
     {
         JobListViewModel jobs = new JobListViewModel(MainNodeName, vmModel.ActiveVMList);
         HpcJobsView    = jobs.View;
         JobActionsView = jobs.ActionsView;
     }
 }
        public void Update([FromBody] JobListViewModel jobApplication)
        {
            JobApplication job = applicationUoW.Repository.GetItem(jobApplication.Id);

            job.Id          = jobApplication.Id;
            job.FirstName   = jobApplication.FirstName;
            job.LastName    = jobApplication.LastName;
            job.Email       = jobApplication.Email;
            job.PhoneNumber = jobApplication.PhoneNumber;

            applicationUoW.Repository.UpdateItem(job);
            applicationUoW.Save();
        }
        public IActionResult Index(int id)
        {
            var model = new JobListViewModel();

            if (id > 0)
            {
                model.Jobs.Add(_jobService.GetById(id));
            }
            else
            {
                model.Jobs = _jobService.GetAll();
            }
            return(View(model));
        }
        public async Task <IActionResult> JobList([FromForm] JobListViewModel model)
        {
            var list = await _mediator.Send(new GetJobListCmd()
            {
                PageIndex        = model.PageNum,
                PageSize         = model.PageSize,
                SearchJobName    = model.SearchJobName,
                SearchExecutorId = model.SearchExecutorId,
                SearchCreateUser = model.SearchCreateUser,
                SearchStatus     = model.SearchStatus
            });

            return(Ok(list));
        }
        // GET: Jobs
        public async Task <IActionResult> Index()
        {
            JobListViewModel model = new JobListViewModel();

            model.Jobs = await(from j in _context.Job
                               join c in _context.Company
                               on j.CompanyId equals c.Id
                               select new JobViewModel
            {
                Id       = j.Id,
                Company  = c.Name,
                JobTitle = j.JobTitle
            }).ToListAsync();
            return(View(model));
        }
Exemple #17
0
        public ActionResult Index(string searchString)
        {
            var jobs      = _jobService.GetAll();
            var companies = _companyService.GetAll();


            if (!string.IsNullOrEmpty(searchString))
            {
                jobs = jobs.Where(w => w.Position.ToLower().Contains(searchString.ToLower())).ToList();
            }

            var jobList = new JobListViewModel()
            {
                Jobs = jobs,
            };

            return(View(jobList));
        }
Exemple #18
0
        public ActionResult Index(string searchString)
        {
            // Use LINQ to get list of genres.


            var jobList = new JobListViewModel();

            if (!string.IsNullOrEmpty(searchString))
            {
                jobList.Jobs.AddRange(_jobService.GetAll().Where(w => w.Position.ToLower().Contains(searchString.ToLower())));
            }
            else
            {
                jobList.Jobs.AddRange(_jobService.GetAll());
            }

            return(View(jobList));
        }
        public IActionResult All(int id = 1)
        {
            if (id <= 0)
            {
                return(this.NotFound());
            }

            const int itemsPerPage = 12;

            var viewModel = new JobListViewModel
            {
                ItemsPerPage = itemsPerPage,
                PageNumber   = id,
                JobsCount    = this.jobsService.GetCount(),
                Jobs         = this.jobsService.GetAll <JobInListViewModel>(id, itemsPerPage),
            };

            return(this.View(viewModel));
        }
Exemple #20
0
        public ActionResult ApprovedJobs()
        {
            var latestJobs = _jobService.GetApprovedJobs().Select(
                j => new JobIndexViewModel
            {
                CreatedBy         = j.CreatedBy.ToString(),
                DateCreated       = j.DateCreated,
                DateCreatedString = j.DateCreated.ToString(),
                JobNumber         = j.JobNo,
                OrderNumber       = j.OrderNo,
                Id = j.Id.ToString()
            }).OrderByDescending(j => j.DateCreated).Take(15);
            var jobList = new JobListViewModel
            {
                CreateViewModel = new JobCreateViewModel(),
                Jobs            = latestJobs
            };

            jobList.CreateViewModel.JobTypes = _listItemService.GetAllByCategory(ListItemCategoryType.JobType).ToSelectList();
            return(View(jobList));
        }
        public IActionResult AllMy(int id = 1)
        {
            var userId = this.User.FindFirst(ClaimTypes.NameIdentifier).Value.ToString();

            if (id <= 0)
            {
                return(this.NotFound());
            }

            const int itemsPerPage = 12;

            var viewModel = new JobListViewModel
            {
                ItemsPerPage = itemsPerPage,
                PageNumber   = id,
                JobsCount    = this.jobsService.GetCount(),
                Jobs         = this.jobsService.GetAllMyJobs <JobInListViewModel>(1, userId),
            };

            return(this.View(viewModel));
        }
Exemple #22
0
        public IActionResult Index()
        {
            TempData["Active"] = "Job";
            List <Job> Jobs = _JobService.GetJobsWithAllColumns();
            List <JobListViewModel> models = new List <JobListViewModel>();

            foreach (var item in Jobs)
            {
                JobListViewModel model = new JobListViewModel()
                {
                    Description = item.Description,
                    ad          = item.Name,
                    ID          = item.ID,
                    Urgency     = item.Urgency,
                    CreatedAt   = item.CreatedAt,
                    UrgencyId   = item.UrgencyId,
                    Status      = item.Status,
                };
                models.Add(model);
            }
            return(View(models));
        }
Exemple #23
0
        public ActionResult SearchByKeyword(string keyword)
        {
            var results = _jobService.SearchByKeyword(keyword).Select(
                j => new JobIndexViewModel
            {
                CreatedBy         = j.CreatedBy.ToString(),
                DateCreated       = j.DateCreated,
                DateCreatedString = j.DateCreated.ToString(),
                JobNumber         = j.JobNo,
                OrderNumber       = j.OrderNo,
                Id = j.Id.ToString()
            }).OrderBy(ji => ji.DateCreated);
            var jobList = new JobListViewModel
            {
                CreateViewModel = new JobCreateViewModel(),
                Page            = 1,
                PageSize        = 15,
                Jobs            = results,
                Total           = results.Count()
            };

            return(PartialView("_SearchResults", jobList));
        }
Exemple #24
0
        public async Task <JobListViewModel> GetTimeLineJobListJobAsync(string userId, int pageNumber)
        {
            var jobListViewModel = new JobListViewModel();
            var pageSize         = 2;
            var queryableJobs    = _dbContext.Jobs
                                   .Include(a => a.Attachments)
                                   .Include(u => u.CreatedUser)
                                   .Include(c => c.JobComments).ThenInclude(cu => cu.CommentedUser).
                                   Where(j => !j.IsDeleted && (j.workflowStatus == JobworkflowStatus.BidRecivedOrApproveWating || j.workflowStatus == JobworkflowStatus.PostedJob)).AsQueryable();

            var ConvertedListJobs = await queryableJobs.ToListAsync();

            var jobList = new List <JobViewModel>();

            jobList = AsJobViewModel(ConvertedListJobs);
            jobListViewModel.Jobs = jobList;

            jobListViewModel.TotalJobs  = queryableJobs.Count();
            jobListViewModel.Jobs       = jobListViewModel.Jobs.Skip((pageNumber - 1) * pageSize).Take(pageSize).ToList();
            jobListViewModel.PageNumber = pageNumber;
            jobListViewModel.PageSize   = pageSize;
            return(jobListViewModel);
        }
Exemple #25
0
        public ActionResult PendingJobs(int page = 1)
        {
            var pageSize = 15;
            var jobs     = _jobService.GetPendingJobs().Select(
                j => new JobIndexViewModel
            {
                CreatedBy         = j.CreatedBy.ToString(),
                DateCreatedString = j.DateCreated.ToString(),
                JobNumber         = j.JobNo,
                OrderNumber       = j.OrderNo,
                Id = j.Id.ToString()
            }).OrderBy(j => j.JobNumber).Skip((page - 1) * pageSize).Take(pageSize);
            var jobList = new JobListViewModel
            {
                CreateViewModel = new JobCreateViewModel(),
                Jobs            = jobs,
                Page            = page,
                PageSize        = pageSize,
                Total           = _jobService.GetApprovedJobsCount()
            };

            jobList.CreateViewModel.JobTypes = _listItemService.GetAllByCategory(ListItemCategoryType.JobType).ToSelectList();
            return(View(jobList));
        }
        public JobListView()
        {
            InitializeComponent();

            BindingContext = new JobListViewModel(this.Navigation);
        }
Exemple #27
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     BindingContext       = new JobListViewModel(Navigation);
     JobList.SelectedItem = null;
 }