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);
        }
示例#2
0
 public void Insert(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Insert(PictureGalery);
 }
示例#3
0
 public void Update(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Update(PictureGalery);
 }
示例#4
0
 public void Delete(PictureGalery PictureGalery)
 {
     _PictureGaleryRepository.Delete(PictureGalery);
 }