// GET: JobRequirements
        public ActionResult Index(int vacancyId)
        {
            JobRequirementIndexModel model = new JobRequirementIndexModel();

            model.VacancyId   = vacancyId;
            model.VacancyName = VacanciesLogic.GetVacancyById(vacancyId).Name;
            return(View(model));
        }
 public ActionResult Delete(int id)
 {
     try
     {
         VacanciesLogic.DeleteVacancy(id);
     }
     catch (Exception e)
     {
         LogsLogic.InsertLog(new Log()
         {
             Message    = e.Message,
             StackTrace = e.StackTrace,
             StoryName  = "MoreHolidays/Vacancies/Delete",
             Parameters = "id=" + id
         });
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult Edit(int id)
        {
            Vacancy vacancy = new Vacancy();

            try
            {
                vacancy = VacanciesLogic.GetVacancyById(id);
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "MoreHolidays/Vacancies/Edit(Get)",
                    Parameters = "id=" + id
                });
            }
            return(View("Edit", vacancy));
        }
 public ActionResult Edit(Vacancy vacancy)
 {
     if (ModelState.IsValid)
     {
         try
         {
             VacanciesLogic.UpdateVacancy(vacancy);
             return(RedirectToAction("Index"));
         }
         catch (Exception e)
         {
             LogsLogic.InsertLog(new Log()
             {
                 Message    = e.Message,
                 StackTrace = e.StackTrace,
                 StoryName  = "MoreHolidays/Vacancies/Edit(Post)",
             });
             return(View(vacancy));
         }
     }
     return(View(vacancy));
 }
        public ActionResult VacanciesList(int?pageNo)
        {
            var            page  = pageNo ?? 0;
            List <Vacancy> model = new List <Vacancy>();

            try
            {
                model = VacanciesLogic.GetVacanciesList(page);
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "MoreHolidays/Vacancies/VacanciesList",
                    Parameters = "& pageNo=" + page
                });
            }

            return(View(model));
        }