Пример #1
0
        /// <summary>
        /// Deletes a support
        /// </summary>
        /// <param name="support">support</param>
        public virtual void Delete(SupportItem support)
        {
            if (support == null)
                throw new ArgumentNullException("Support");

            _supportRepository.Delete(support);

            _cacheManager.RemoveByPattern(SUPPORT_PATTERN_KEY);

            //event notification
            _eventPublisher.EntityDeleted(support);
        }
        public ActionResult Add(SupportItemModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel))
                return Content("Access denied");
            var support = new SupportItem
            {
                LanguageId = _workContext.WorkingLanguage.Id,
                Id = model.Id,
                YahooId = model.YahooId,
                SkypeId = model.SkypeId,
                Name = model.Name,
                Phone = model.Phone,
                HotLine = model.HotLine,
                DisplayOrder = model.DisplayOrder,
                Image = model.Image

            };
            _supportService.Insert(support);
            return new NullJsonResult();
        }