Beispiel #1
0
        public ActionResult CreateJobPost(string Title, string Description, DateTime StartDate, DateTime EndDate, string JobTitle, int WorkHours, string Address, Company Company, int JobCategory)
        {
            WorkHours workHours = new WorkHours {
                Id = WorkHours
            };

            CompanyServiceReference.JobCategory jobCategory = new CompanyServiceReference.JobCategory {
                Id = JobCategory
            };
            Company company = Session["company"] as Company;
            JobPost jobPost = new JobPost
            {
                Title       = Title,
                Description = Description,
                StartDate   = StartDate.Date,
                EndDate     = EndDate.Date,
                JobTitle    = JobTitle,
                workHours   = workHours,
                Address     = Address,
                company     = company,
                jobCategory = jobCategory
            };

            try
            {
                client.CreateJobPost(jobPost);
                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                throw;
            }
        }