示例#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);
        }
        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);
 }
 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);
 }