partial void UpdatejobAdvertisment(jobAdvertisment instance);
 partial void DeletejobAdvertisment(jobAdvertisment instance);
 partial void InsertjobAdvertisment(jobAdvertisment instance);
 public jobAdvertisment updateJobPost(jobAdvertisment oldJobAdvert,jobAdvertisment newJobAdvert)
 {
     oldJobAdvert.yearOfExperienceRequired = newJobAdvert.yearOfExperienceRequired;
     oldJobAdvert.jobPosition = newJobAdvert.jobPosition;
     oldJobAdvert.jobDescription = newJobAdvert.jobDescription;
     oldJobAdvert.closeDate = newJobAdvert.closeDate;
     oldJobAdvert.noOfemployeeRequired = newJobAdvert.noOfemployeeRequired;
     oldJobAdvert.jobTypeId = newJobAdvert.jobTypeId;
     oldJobAdvert.modifiedDate = DateTime.Now;
     //jobAdvertisment jobAdvert = new jobAdvertisment();
     //jobAdvert = newJobAdvert;
     return oldJobAdvert;
 }
        public ActionResult JobPost(jobAdvertisment jobAdvert)
        {
            jobAdvert.createdDate = DateTime.Now;

            jobAdvert.jobAdvertismentId = getJobAdvertId();
            db2.jobAdvertisments.InsertOnSubmit(jobAdvert);
            db2.SubmitChanges();

            return RedirectToAction("ViewJobPost", "Employer", new {jobAdvertId = jobAdvert.jobAdvertismentId, id = 0 });
        }
        public ViewResult JobPost(string employerId)
        {
            //ViewBag.maritalId = new SelectList(db2.maritalDefs, "maritalStatusId", "maritalStatusName", per.martialStatusId.GetValueOrDefault());

            employerRegistration empRegistration = (from dt in db2.employerRegistrations where dt.employerid.ToString() == employerId.Trim() select dt).SingleOrDefault();
            jobAdvertisment jobAdver = new jobAdvertisment();
            jobAdver.employerid = empRegistration.employerid; // Guid.Parse(empRegistration.employerid.ToString());
            return View(jobAdver);
        }
        public ActionResult EditJobPost(jobAdvertisment jobAdvert)
        {
            jobAdvertisment dbJobAdvert = (from dt in db2.jobAdvertisments where dt.jobAdvertismentId == jobAdvert.jobAdvertismentId.Trim() select dt).SingleOrDefault();

            dbJobAdvert = updateJobPost(dbJobAdvert, jobAdvert);

            // dbJobAdvert.yearOfExperienceRequired = "10";
            db2.SubmitChanges();

            return RedirectToAction("ViewJobPost", "Employer", new { jobAdvertId = jobAdvert.jobAdvertismentId, id = 0 });
        }