Ejemplo n.º 1
0
        /// <summary>
        /// The Save
        /// </summary>
        /// <param name="entity">The entity<see cref="Licence"/></param>
        /// <returns>The <see cref="ServiceResult"/></returns>
        public ServiceResult Save(Licence 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()
                });
            }
        }
Ejemplo n.º 2
0
        public void CreateLicence(LicencePivot licence)
        {
            GES_Licence item = Mapper.Map <LicencePivot, GES_Licence>(licence);

            licenceRepository.Add(item);
        }
Ejemplo n.º 3
0
 public Licence Add(Licence newLicence)
 {
     return(_licenceRepository.Add(newLicence));
 }