public HomeModule() { Get["/"] = _ => View["home.cshtml"]; Get["/add_job"] = _ => View["add_job.cshtml"]; Post["/post_job"] = _ => { JobOpening newJobOpening = new JobOpening( Request.Form["title"], Request.Form["description"], Request.Form["salary"], Request.Form["name"], Request.Form["phone"], Request.Form["email"] ); newJobOpening.Save(); return(View["view_job.cshtml", newJobOpening]); }; Get["/view_all"] = _ => { List <JobOpening> allJobs = JobOpening.GetJobs(); return(View["job_board.cshtml", allJobs]); }; Get["/search_form"] = _ => View["search_form.cshtml"]; Post["/search_jobs"] = _ => { List <JobOpening> searchedJobs = JobOpening.SearchJobs(Request.Form["search-keyword"], Request.Form["min-salary"]); return(View["job_board.cshtml", searchedJobs]); }; }
public ActionResult CreateJob() { Contact jobContact = new Contact(Request.Form["contact-name"], Request.Form["contact-email"], Request.Form["contact-phone"]); JobOpening newJob = new JobOpening(Request.Form["job-title"], Request.Form["job-description"], int.Parse(Request.Form["experience"]), Request.Form["job-location"], jobContact); newJob.Save(); return(View(newJob)); }
public ActionResult Create() { JobOpening allJobs = new JobOpening(Request.Form["new-title"], Request.Form["new-description"], Request.Form["new-contactInfo"]); allJobs.Save(); List <JobOpening> allJobss = JobOpening.GetAll(); return(View("Index", allJobss)); }
public ActionResult Create() { JobOpening newJob = new JobOpening(Request.Form["new-title"], Request.Form["new-description"], Request.Form["new-name"], Request.Form["new-phoneNumber"], Request.Form["new-email"]); // Dictonary newContact = new Dictionary(); newJob.Save(); // newContact.Save(); List <JobOpening> allJobs = JobOpening.GetList(); return(View("Index", allJobs)); }
public ActionResult Create() { string newJobTitle = Request.Form["title"]; string newJobDescription = Request.Form["description"]; string newJobContact = Request.Form["contact"]; JobOpening newJobOpening = new JobOpening(newJobTitle, newJobDescription, newJobContact); newJobOpening.Save(); List <JobOpening> allJobs = JobOpening.GetAll(); return(View("Index", allJobs)); }