Example #1
0
 /// <summary>
 /// The Delete
 /// </summary>
 /// <param name="entity">The entity<see cref="Licence_term"/></param>
 /// <returns>The <see cref="ServiceResult"/></returns>
 public ServiceResult Delete(Licence_term entity)
 {
     try
     {
         _repository.Delete(entity);
         return(new ServiceResult(true));
     }
     catch (Exception ex)
     {
         return(new ServiceResult(false)
         {
             Error = ex.ToString()
         });
     }
 }
Example #2
0
        /// <summary>
        /// The Save
        /// </summary>
        /// <param name="entity">The entity<see cref="Licence_term"/></param>
        /// <returns>The <see cref="ServiceResult"/></returns>
        public ServiceResult Save(Licence_term entity)
        {
            try
            {
                if (entity.Identifier == 0)
                {
                    _repository.Add(entity);
                }
                else
                {
                    _repository.Update(entity);
                }

                return(new ServiceResult(true));
            }
            catch (Exception ex)
            {
                return(new ServiceResult(false)
                {
                    Error = ex.ToString()
                });
            }
        }