Example #1
0
        public bool Save(FlagSetting entity)
        {
            bool isSuccess = false;

            if (string.IsNullOrEmpty(entity.Id))
            {
                _repository.Insert<FlagSetting>(entity);

                isSuccess = !string.IsNullOrEmpty(entity.Id) ? true : false;

                if (isSuccess) _redisCache.SetValue(entity.Name, entity.FlagValue);

                return isSuccess;
            }
            else
            {
                isSuccess = _repository.Update<FlagSetting>(entity);

                if (isSuccess) _redisCache.SetValue(entity.Name, entity.FlagValue);
            }

            return isSuccess;
        }
Example #2
0
        public ActionResult Save(FlagSetting model)
        {
            _repository.Save(model);

            return RedirectToAction("Index");
        }
Example #3
0
        //
        // GET: /FlagSetting/Create
        public ActionResult Create()
        {
            var model = new FlagSetting();

            return View(model);
        }