Esempio n. 1
0
        /// <summary>
        /// Deletes a store
        /// </summary>
        /// <param name="store">Company</param>
        public virtual void DeleteCompany(Company store)
        {
            if (store == null)
                throw new ArgumentNullException("store");

            var allCompanys = GetAllCompanys();
            if (allCompanys.Count == 1)
                throw new Exception("You cannot delete the only configured store");

            _companyRepository.Delete(store);

            _cacheManager.RemoveByPattern(STORES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityDeleted(store);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the store
        /// </summary>
        /// <param name="store">Company</param>
        public virtual void UpdateCompany(Company store)
        {
            if (store == null)
                throw new ArgumentNullException("store");

            _companyRepository.Update(store);

            _cacheManager.RemoveByPattern(STORES_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityUpdated(store);
        }