Exemple #1
0
        public ActionResult Update(Certification certification)
        {
            ApiResult <Certification> apiResult;

            if (ModelState.IsValid)
            {
                if (certification.Id > 0)
                {
                    apiResult = TryExecute(() =>
                    {
                        _certificationRepository.Update(certification);
                        _unitOfWork.Commit();
                        return(certification);
                    }, "Certification updated sucessfully");
                }
                else
                {
                    apiResult = TryExecute(() =>
                    {
                        _certificationRepository.Create(certification);
                        _unitOfWork.Commit();
                        return(certification);
                    }, "Certification created sucessfully");
                }
            }
            else
            {
                apiResult = ApiResultFromModelErrors <Certification>();
            }

            return(Json(apiResult, JsonRequestBehavior.AllowGet));
        }
 public ActionResult Edit(Certification certification)
 {
     if (ModelState.IsValid)
     {
         _certificationRepository.Update(certification);
         _unitOfWork.Commit();
         return(RedirectToAction("Index"));
     }
     return(View(certification));
 }
Exemple #3
0
 public int UpdateCertification(DLModel.Certification _certification)
 {
     return(_certificationRepository.Update((DLModel.Certification) new DLModel.Certification().InjectFrom(_certification)));
 }
Exemple #4
0
 public void Update(CertificationDto entity)
 {
     repo.Update(entity);
 }