Example #1
0
 public IActionResult edit(CareerDto career_dto)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _careerService.update(career_dto);
             AlertHelper.setMessage(this, "Career updated successfully.");
             return(RedirectToAction("index"));
         }
     }
     catch (Exception ex)
     {
         AlertHelper.setMessage(this, ex.Message, messageType.error);
     }
     return(View(career_dto));
 }
 public IActionResult edit(CareerDto career_dto, IFormFile file = null)
 {
     try
     {
         if (ModelState.IsValid)
         {
             if (file != null)
             {
                 string fileName = career_dto.title;
                 career_dto.image_name = _fileHelper.saveImageAndGetFileName(file, fileName);
             }
             _careerService.update(career_dto);
             AlertHelper.setMessage(this, "Career updated successfully.");
             return(RedirectToAction("index"));
         }
     }
     catch (Exception ex)
     {
         AlertHelper.setMessage(this, ex.Message, messageType.error);
     }
     return(View(career_dto));
 }