Ejemplo n.º 1
0
 public ActionResult EditPhoto(GalleryEditModel model)
 {
     if (ModelState.IsValid)
     {
         galleryServices.EditGallery(model);
         return(RedirectToAction("Photo"));
     }
     return(View(model));
 }
Ejemplo n.º 2
0
 public bool EditGallery(GalleryEditModel model)
 {
     try
     {
         var result = unitOfwork.GalleriesRepo.Get(filter: x => x.Id == (Guid)model.Id).FirstOrDefault();
         result.Url         = model.Url;
         result.IsImage     = model.IsImage;
         result.IsFeatured  = model.IsFeatured;
         result.IsActive    = model.IsActive;
         result.IsSlider    = model.IsSlider;
         result.Description = model.Description;
         unitOfwork.GalleriesRepo.Update(result);
         return(unitOfwork.Save() > 0);
     }
     catch (Exception)
     {
         throw;
     }
 }