Example #1
0
 public HomeModule()
 {
     Get["/"] = _ => View["add_new_job.cshtml"];
       Get["/view_all_jobs"] = _ => {
     List<JobOpening> allJobs = JobOpening.GetAll();
     return View["view_all_jobs.cshtml", allJobs];
       };
       Post["/jobs_cleared"] = _ => {
     JobOpening.ClearAll();
     return View["jobs_cleared.cshtml"];
       };
       Post["/job_added"] = _ => {
     Contact contact = new Contact(Request.Form["posterName"],Request.Form["posterEmail"],Request.Form["posterPhone"]);
     JobOpening newJob = new JobOpening(Request.Form["jobTitle"], Request.Form["jobDescription"], contact);
     JobOpening.Save(newJob);
     return View["job_added.cshtml", newJob];
       };
 }
        public HomeModule()
        {
            Get["/"] = _ => View["add_new_job.cshtml"];

              // Get["/view_all_jobs"] = _ => {
              //   List<string> allTasks = JobOpening.GetAll();
              //   return View["view_all_jobs.cshtml", allJobs];
              // };
              // Post["/tasks_cleared"] = _ => {
              //   Task.ClearAll();
              //   return View["tasks_cleared.cshtml"];
              // };

              Post["/job_added"] = _ => {
            contactInfo newContact = new contactInfo();
            newContact.Contact(Request.Form["name"], Request.Form["email"], Request.Form["phone-number"]);
            JobOpening newJobOpening = new JobOpening();
            newJobOpening.Job(Request.Form["title"], Request.Form["description"], newContact);
            newJobOpening.Save();
            return View["job_added.cshtml", newJobOpening];
              };
        }
Example #3
0
 public static void Save(JobOpening job)
 {
     _jobs.Add(job);
 }