Example #1
0
 public PopUpModel GetActivePopUp()
 {
     PopUpModel popUpModel = null;
     using (var unitOfWork = _unitOfWorkFactory.Create())
     {
         try
         {
             var entity = unitOfWork.PopUpRepository.Get(x => x.Active).Single();
             popUpModel = new PopUpModel(entity);
         }
         catch (Exception e)
         {
             _logger.LogToFile(_logger.CreateErrorMessage(e));
         }
     }
     return popUpModel;
 }
Example #2
0
 public ResponseBase Update(PopUpModel popUp)
 {
     ResponseBase response;
     using (var unitOfWork = _unitOfWorkFactory.Create())
     {
         try
         {
             if (popUp != null)
             {
                 unitOfWork.PopUpRepository.Update(popUp.ToEntity());
             }
             unitOfWork.Save();
             response = new ResponseBase() { IsSucceed = true, Message = Modules.Resources.Logic.PopUpModifySuccess };
         }
         catch (Exception e)
         {
             _logger.LogToFile(_logger.CreateErrorMessage(e));
             response = new ResponseBase() { IsSucceed = false, Message = Modules.Resources.Logic.PopUpModifyFailed };
         }
     }
     return response;
 }