Пример #1
0
        /// <summary>
        /// Deletes a setting
        /// </summary>
        /// <param name="setting">Setting</param>
        public virtual void DeleteSetting(Setting setting)
        {
            if (setting == null)
            {
                throw new ArgumentNullException("setting");
            }

            _settingRepository.Delete(setting);

            //cache
            _cacheManager.RemoveByPattern(SETTINGS_PATTERN_KEY);
        }
Пример #2
0
        public ActionResult DeleteConfirmed(long id)
        {
            settingRepository.Delete(id);
            settingRepository.Save();

            return(RedirectToAction("Index"));
        }
Пример #3
0
        public async Task <IActionResult> Delete(int id)
        {
            await settingRepository.Delete(id);

            await unitOfWork.SaveEntitiesAsync();

            return(Ok());
        }
Пример #4
0
        public async Task <JsonResult> DeleteConfirmed(int id)
        {
            {
                await _settingRepository.Delete(id);

                return(Json("Excluded Time"));
            }
        }
Пример #5
0
        public virtual void Delete(int id)
        {
            var setting = _settingRepository.GetById(id);

            _settingRepository.Delete(setting);
            _settingRepository.SaveChanges();

            _settingRepository.InvalidateCache(); //find a smart way not to load all the settings again
        }
Пример #6
0
        public void DeleteSetting(SettingKeys key)
        {
            var setting = _settingRepository.FindBy(t => t.Key == key.ToString()).FirstOrDefault();

            if (setting != null)
            {
                _settingRepository.Delete(setting);
                _settingRepository.Commit();
            }
        }
Пример #7
0
        public ActionResult Delete(int Id)
        {
            if (_settingRepository.GetById(Id).IsLocked == true)
            {
                TempData["AlertMessage"] = App_GlobalResources.Wording.SettingDeleteError;
                return(RedirectToAction("Index"));
            }

            _settingRepository.Delete(Id);
            TempData["AlertMessage"] = App_GlobalResources.Wording.DeleteSuccess;
            return(RedirectToAction("Index"));
        }
Пример #8
0
        public ActionConfirmation Delete(int id)
        {
            var setting = Get(id);

            if (setting == null)
            {
                return(ActionConfirmation.CreateFailure("Setting does not exist"));
            }

            try
            {
                _settingRepository.Delete(setting.Id);
                return(ActionConfirmation.CreateSuccess("setting deleted!"));
            }
            catch (System.Exception exception)
            {
                _eventLogService.AddException(exception.Message, exception.StackTrace, EventCategory.EliminarObjeto.ToString(), exception, "", EventSource.Sistema);

                var confirmation = ActionConfirmation.CreateFailure("setting not deleted | " + exception);
                return(confirmation);
            }
        }
Пример #9
0
 public void DeleteSetting(Setting setting)
 {
     settingRepository.Delete(setting);
 }
Пример #10
0
 public void DeleteSetting(long id)
 {
     settingRepository.Delete(x => x.Id == id);
 }
Пример #11
0
 public void DeleteSetting(long id)
 {
     SettingRepository.Delete(c => c.Id == id);
 }
Пример #12
0
 public virtual void Delete(SettingInfo settingInfo)
 {
     _settingRepository
     .Delete(s => s.TenantId == settingInfo.TenantId && s.UserId == settingInfo.UserId && s.Name == settingInfo.Name);
 }
Пример #13
0
 public bool Delete(Setting entity)
 {
     _settingRepository.Delete(entity);
     return(true);
 }