コード例 #1
0
        // GET: JobRequirements
        public ActionResult Index(int vacancyId)
        {
            JobRequirementIndexModel model = new JobRequirementIndexModel();

            model.VacancyId   = vacancyId;
            model.VacancyName = VacanciesLogic.GetVacancyById(vacancyId).Name;
            return(View(model));
        }
コード例 #2
0
 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"));
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 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));
 }
コード例 #5
0
        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));
        }