Ejemplo n.º 1
0
        public ActionResult AddPictureGalery(PictureGaleryModel model)
        {
            var PictureGalery = new PictureGalery();

            if (ModelState.IsValid)
            {
                PictureGalery.Description = model.Description;
                PictureGalery.InsertDate = DateTime.Now;
                PictureGalery.InsertUserId = CustomMembership.CurrentUser().Id;
                PictureGalery.IsActive = model.IsActive;
                PictureGalery.Name = model.Name;

                try
                {
                    _PictureGaleryService.Insert(PictureGalery);
                    _uow.SaveChanges();

                    messagesForView.Clear();
                    messagesForView.Add("İşlemi başarılı!");
                    Success(messagesForView);

                    return RedirectToAction("Index");
                }
                catch (Exception ex)
                {
                    messagesForView.Clear();
                    messagesForView.Add("İşlem başarısız!");
                    messagesForView.Add(ex.Message);
                    messagesForView.Add(ex.InnerException.Message);
                    Error(messagesForView);
                }
            }

            return View(model);
        }
Ejemplo n.º 2
0
 public void Insert(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Insert(PictureGalery);
 }
Ejemplo n.º 3
0
 public void Update(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Update(PictureGalery);
 }
Ejemplo n.º 4
0
 public void Delete(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Delete(PictureGalery);
 }