コード例 #1
0
        public ActionResult Create(JobPosition jobposition)
        {
            if (ModelState.IsValid)
            {
                uow.JobPositiontRepository.Add(jobposition);
                uow.Save();
                return RedirectToAction("Index", "JobPosition", new { recruitmentAgencyId = jobposition.RecruitmentAgencyId } );
            }

            PopulateFields(jobposition);
            return View(jobposition);
        }
コード例 #2
0
 public object Update(JobPosition record)
 {
     try
     {
         uow.JobPositiontRepository.Update(record);
         uow.Save();
         return new { Result = "OK" };
     }
     catch (Exception ex)
     {
         return new { Result = "ERROR", Message = ex.Message };
     }
 }
コード例 #3
0
        //
        // GET: /JobPosition/Create
        public ActionResult Create(int? RecruitmentAgencyId)
        {
            JobPosition jobposition = new JobPosition();
            if (RecruitmentAgencyId != null)
            {
                jobposition.RecruitmentAgencyId = RecruitmentAgencyId.Value;
            }
            else
            {
                PopulateFields();
            }

            return View(jobposition);
        }
コード例 #4
0
 private void PopulateFields(JobPosition jobposition = null)
 {
     if (jobposition != null)
     {
         ViewBag.RecruitmentAgencyId = new SelectList(uow.RecruitmentAgencyRepository.All(), "RecruitmentAgencyId", "Name", jobposition.RecruitmentAgencyId);
     }
     else
     {
         ViewBag.RecruitmentAgencyId = new SelectList(uow.RecruitmentAgencyRepository.All(), "RecruitmentAgencyId", "Name");
     }
 }
コード例 #5
0
 public ActionResult Edit(JobPosition jobposition)
 {
     if (ModelState.IsValid)
     {
         uow.JobPositiontRepository.Update(jobposition);
         uow.Save();
         return RedirectToAction("Index");
     }
     uow.JobPositiontRepository.Add(jobposition);
     return View(jobposition);
 }