Exemple #1
0
 public OperationResult <bool> Update(Brand item)
 {
     try
     {
         if (_dao.List().Any(x => x.Name.ToLower().Trim() == item.Name.ToLower().Trim() && x.Id != item.Id && !x.IsDeleted))
         {
             return new OperationResult <bool>()
                    {
                        Success = true, Result = false, Message = "Name already exists"
                    }
         }
         ;
         _dao.Update(item);
         return(new OperationResult <bool>()
         {
             Success = true, Result = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult <bool>()
         {
             Success = false, Exception = e
         });
     }
 }
Exemple #2
0
 public OperationResult Update(Brand brand)
 {
     try
     {
         _dao.Update(brand);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }