Exemplo n.º 1
0
        private void SaveSetting()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("executetime", "days");

            PointLogClearSettings setting = new PointLogClearSettings();

            setting.SaveLogDays   = _Request.Get <int>("SaveDays", Method.Post, 30);
            setting.DataClearMode = _Request.Get <JobDataClearMode>("DataClearMode", JobDataClearMode.Disabled);
            setting.SaveLogRows   = _Request.Get <int>("SaveRows", Method.Post, 10000);

            if (msgDisplay.HasAnyError())
            {
                return;
            }

            try
            {
                using (new ErrorScope())
                {
                    bool success = SettingManager.SaveSettings(setting);

                    if (!success)
                    {
                        CatchError <ErrorInfo>(delegate(ErrorInfo error)
                        {
                            msgDisplay.AddError(error);
                        });
                    }
                    else
                    {
                        string rawUrl = Request.RawUrl;

                        BbsRouter.JumpToUrl(rawUrl, "success=1");
                    }
                }
            }
            catch (Exception ex)
            {
                msgDisplay.AddError(ex.Message);
            }
        }
Exemplo n.º 2
0
        public void ClearPointLogData()
        {
            PointLogClearSettings settings = AllSettings.Current.PointLogClearSettings;

            PointLogDao.Instance.ClearPointLogs(settings.SaveLogDays, settings.SaveLogRows, settings.DataClearMode);
        }