コード例 #1
0
 public IServiceResults<bool> Edit(YearEvents model)
 {
     _yearEvents.Attach(model);
     _uow.Entry(model).State = EntityState.Modified;
     var result = _uow.SaveChanges();
     return new ServiceResults<bool>()
     {
         IsSuccessfull = result.ToBool(),
         Message = result.ToMessage(BusinessMessage.Error),
         Result = result.ToBool()
     };
 }
コード例 #2
0
        public IServiceResults<int> Add(YearEvents model)
        {
            _yearEvents.Add(model);
            var saveResult = _uow.SaveChanges();

            return new ServiceResults<int>
            {
                IsSuccessfull = saveResult.ToBool(),
                Message = saveResult.ToMessage(BusinessMessage.Error),
                Result = model.YearEventsId
            };
        }
コード例 #3
0
 public virtual ActionResult Edit(YearEvents model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     var result = _yearEventsService.Edit(model);
     if (!result.IsSuccessfull)
     {
         this.NotificationController().Notify(result.Message, NotificationStatus.Error);
         return View(model);
     }
     return RedirectToAction(MVC.YearEvents.ActionNames.Add, MVC.YearEvents.Name);
 }
コード例 #4
0
 private void _OneYearEvents()
 {
     YearEvents?.Invoke();
 }