/// <summary>
        /// Deletes a pickup point
        /// </summary>
        /// <param name="model">Pickup point</param>
        public virtual void Delete(FaraBotConfig model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            _ModelRepository.Delete(model);
            _cacheManager.RemoveByPattern(model_POINT_PATTERN_KEY);
        }
예제 #2
0
        public IActionResult Get()
        {
            var model = _BotConfigService.Get();

            if (model == null)
            {
                model = new FaraBotConfig();
            }

            return(View("~/Plugins/Faradata.AlarmShopping/Views/Config.cshtml", model));
        }
예제 #3
0
        public IActionResult Post(FaraBotConfig model)
        {
            try
            {
                if (model.Id > 0)
                {
                    _BotConfigService.Update(model);
                }
                else
                {
                    _BotConfigService.Insert(model);
                }

                TempData["message"] = "تغییرات با موفقیت ذخیره شد.";
            }
            catch (Exception ee)
            {
                TempData["message"] = "خطا در زمان ذخیره تغییرات.";
            }

            var modelOut = _BotConfigService.Get();

            return(View("~/Plugins/Faradata.AlarmShopping/Views/Config.cshtml", modelOut));
        }