Example #1
0
        /// <summary>
        /// 执行更改并保存配置
        /// </summary>
        private void AcceptSetting(SettingInfo newSet)
        {
            if (newSet.Boot)
                MyWork.startExePath.CheckRegRun();
            else
                RegWork.DelRegRun();

            if (newSet.SysRightMenu)
                MyWork.startExePath.AddRegMenu();
            else
                RegWork.DelRegMenu();
            //hotkey

            newSet.SaveToConfig(MyWork.ConfigPath);
        }
Example #2
0
      internal void Handle(UpdateSettingsSection input) {
         using (var dbConn = DatabaseManager.DbConn()) {
            dbConn.BeginTransaction();

            var s = new SettingInfo();

            s.DriverId = input.DriverId;
            s.ApplicationId = input.ApplicationId;
            s.Name = input.Section;
            s.Value = _format(input.Values);
            s.DataSource = DataSources.Driver;

            dbConn.ExecuteBpl(new SettingSave(s));

            dbConn.CommitTransaction();
         }

         Reply(true);
      }
Example #3
0
#pragma warning restore 1998

            public Task UpdateAsync(SettingInfo setting)
            {
                Update(setting);
                return(Task.CompletedTask);
            }
Example #4
0
 public async Task DeleteAsync(SettingInfo setting)
 {
     _settings.RemoveAll(a => a.TenantId == setting.TenantId && a.UserId == setting.UserId && a.Name == setting.Name);
 }
Example #5
0
 public void Delete(SettingInfo setting)
 {
     _settings.RemoveAll(s =>
                         s.TenantId == setting.TenantId && s.UserId == setting.UserId && s.Name == setting.Name);
 }
Example #6
0
        public void ProcessRequest(HttpContext context)
        {
            if (!context.User.Identity.IsAuthenticated)
            {
                return;
            }

            //context.Response.ContentType = "application/json";
            var jobName     = context.Request.Form["JOB_NAME"];
            var jobGroup    = context.Request.Form["JOB_GROUP"];
            var description = context.Request.Form["DESCRIPTION"] ?? string.Empty;
            var cron        = context.Request.Form["CRON_EXPRESSION"];
            var time1       = context.Request.Form["START_TIME"];
            var time2       = context.Request.Form["END_TIME"];
            var host        = context.Request.Form["REQUESTHOST"];
            var path        = context.Request.Form["REQUESTPATH"];

            if (string.IsNullOrEmpty(cron))
            {
                return;
            }

            var info = new SettingInfo
            {
                CRON_EXPRESSION = cron,
                DESCRIPTION     = description,
                END_TIME        = time2,
                START_TIME      = time1,
                JOB_NAME        = jobName,
                JOB_GROUP       = jobGroup,
                REQUESTHOST     = host,
                REQUESTPATH     = path,
                HOST            = context.Request.Form["HOST"] ?? string.Empty,
                TRIGGER_GROUP   = jobGroup,
                TRIGGER_NAME    = "TN_" + DateTime.Now.Ticks,
            };

            DateTime temp;

            if (!DateTime.TryParse(info.START_TIME, out temp))
            {
                info.START_TIME = DateTime.Now.AddYears(-1).ToString();
            }
            if (!DateTime.TryParse(info.END_TIME, out temp))
            {
                info.END_TIME = DateTime.Now.AddYears(100).ToString();
            }

            if (string.IsNullOrEmpty(info.JOB_NAME))
            {
                info.JOB_NAME = string.Format("Job{0}{1}", info.REQUESTPATH.Replace("/", string.Empty).Trim(), DateTime.Now.ToString("fff"));

                DbHelper.InsertSetting(info);
                context.Response.Write(info.JOB_NAME);
            }
            else
            {
                var count = DbHelper.UpdateSetting(info);
                context.Response.Write(count.ToString());
            }
        }
Example #7
0
 public void UpdateSetting(SettingInfo objSetting)
 {
     dataProvider.UpdateSetting(objSetting.SettingId, objSetting.Description, objSetting.Attachments, objSetting.Emoticons, objSetting.Html, objSetting.PostIcon, objSetting.Rss, objSetting.Scripts, objSetting.Moderated, objSetting.AutoTrustLevel, objSetting.AttachMaxCount, objSetting.AttachMaxSize, objSetting.AttachAutoResize, objSetting.AttachMaxHeight, objSetting.AttachMaxWidth, objSetting.AttachStore, objSetting.EditorType, objSetting.EditorHeight, objSetting.EditorWidth, objSetting.Filters);
     //Caching.ClearSettingsCache();
 }
 private void Delete()
 {
     SettingInfo.Current.ServerInfoes.Remove(ServerInfo);
     SettingInfo.SaveSettingInfo();
     MainWindowViewModel.MainFrame.GoBack();
 }
Example #9
0
        private async Task <bool> VerifyPermissions(SettingInfo settingInfo)
        {
            var settings = BotSettings.Instance;
            var user     = Context.User as IGuildUser;

            if (user.GuildPermissions.Has(GuildPermission.Administrator))
            {
                return(true);
            }
            string roleName = settings.GetGuildSettingOrDefault <string>("admin:bot-role-name", Context.Guild.Id)[0];

            if (settingInfo.PermissionRole && GetUserRoleNames(user).Contains(roleName))
            {
                return(true);
            }
            foreach (var permission in settingInfo.GuildPermissions)
            {
                if (user.GuildPermissions.Has(permission))
                {
                    return(true);
                }
            }
            foreach (var permission in settingInfo.ChannelPermissions)
            {
                if (user.GetPermissions(Context.Channel as IGuildChannel).Has(permission))
                {
                    return(true);
                }
            }

            string message = "";

            if (settingInfo.PermissionRole)
            {
                message += $"A role named `{roleName}`\n\n";
            }
            if (settingInfo.GuildPermissions.Count > 0)
            {
                message += $"Server permissions```";
                foreach (var permission in settingInfo.GuildPermissions)
                {
                    message += "\n" + permission.ToString();
                }
                message += "```\n\n";
            }
            if (settingInfo.ChannelPermissions.Count > 0)
            {
                message += "Channel permissions```";
                foreach (var permission in settingInfo.ChannelPermissions)
                {
                    message += "\n" + permission.ToString();
                }
                message += "```";
            }
            var eb = new EmbedBuilder()
            {
                Title       = "Insufficient permissions, must have either of the following to alter this command:",
                Description = message
            };

            await ReplyAsync(embed : eb.Build());

            return(false);
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetPageTitle("主题管理");

            string[] filelist = Directory.GetFileSystemEntries(Server.MapPath("../themes/default"));
            foreach (string str in filelist)
            {
                //   Response.Write(str+"<br>");
            }
            //   System.IO.Directory.Delete(Server.MapPath("../themes/test"),true);

            string type = RequestHelper.QueryString("type", true);

            if (Operate == OperateType.Update)
            {
                SettingInfo s = SettingManager.GetSetting();

                switch (type)
                {
                case "mobile":
                    s.MobileTheme = themename;
                    break;

                case "pc":
                default:
                    s.Theme = themename;
                    break;
                }
                SettingManager.UpdateSetting();

                Response.Redirect("themelist.aspx?result=2");
            }
            else if (Operate == OperateType.Insert)
            {
                string srcPath = Server.MapPath("../themes/" + themename);

                if (!string.IsNullOrEmpty(themename) && System.IO.Directory.Exists(srcPath))
                {
                    string aimPath = string.Empty;
                    int    count   = 1;
                    while (true)
                    {
                        count++;
                        aimPath = Server.MapPath("../themes/" + themename + "-" + count);
                        if (!System.IO.Directory.Exists(aimPath))
                        {
                            break;
                        }
                    }
                    CopyDir(srcPath, aimPath);
                    Response.Redirect("themelist.aspx?result=1");
                }
            }
            else if (Operate == OperateType.Delete)
            {
                if (themename == "default")
                {
                    Response.Redirect("themelist.aspx?result=5");
                }
                else
                {
                    string path = Server.MapPath("../themes/" + themename);
                    if (System.IO.Directory.Exists(path))
                    {
                        System.IO.Directory.Delete(path, true);
                        Response.Redirect("themelist.aspx?result=3");
                    }
                }
            }

            ShowResult();
        }
Example #11
0
    /// <summary>
    /// 编辑
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        SettingInfo s = SettingManager.GetSetting();

        if (s != null)
        {
            s.SiteName        = StringHelper.HtmlEncode(txtSiteName.Text);
            s.SiteDescription = StringHelper.HtmlEncode(txtSiteDescription.Text);
            s.MetaKeywords    = StringHelper.HtmlEncode(txtMetaKeywords.Text);
            s.MetaDescription = StringHelper.HtmlEncode(txtMetaDescription.Text);

            //   s.RewriteExtension = ddlRewriteExtension.SelectedValue;
            s.SiteStatus = chkSiteStatus.Checked ? 1 : 0;

            //  s.CommentApproved = chkCommentApproved.Checked ? 1 : 0;
            //    //c.GuestBookVerifyStatus = chkGuestBookVerifyStatus.Checked ? 1 : 0;
            s.EnableVerifyCode = chkEnableVerifyCode.Checked ? 1 : 0;



            //  s.PageSizeTagCount = StringHelper.StrToInt(txtPageSizeTagCount.Text, 10);
            s.PageSizePostCount    = StringHelper.StrToInt(txtPageSizePostCount.Text, 10);
            s.PageSizeCommentCount = StringHelper.StrToInt(txtPageSizeCommentCount.Text, 50);

            s.SidebarPostCount    = StringHelper.StrToInt(txtSidebarPostCount.Text, 10);
            s.SidebarTagCount     = StringHelper.StrToInt(txtSidebarTagCount.Text, 10);
            s.SidebarCommentCount = StringHelper.StrToInt(txtSidebarCommentCount.Text, 10);

            //    //c.TagArticleNum = StringHelper.StrToInt(txtTagArticleNum.Text, 10);

            s.FooterHtml = txtFooterHtml.Text;

            //    //c.ArticleShowType = StringHelper.StrToInt(ddlArticleShowType.SelectedValue, 0);


            //水印

            s.WatermarkType         = StringHelper.StrToInt(ddlWatermarkType.SelectedValue, 1);
            s.WatermarkText         = txtWatermarkText.Text;
            s.WatermarkFontName     = ddlWatermarkFontName.SelectedValue;
            s.WatermarkFontSize     = StringHelper.StrToInt(ddlWatermarkFontSize.SelectedValue, 14);
            s.WatermarkImage        = txtWatermarkImage.Text;
            s.WatermarkTransparency = StringHelper.StrToInt(ddlWatermarkTransparency.SelectedValue, 10);
            s.WatermarkPosition     = StringHelper.StrToInt(ddlWatermarkPosition.SelectedValue, 1);
            s.WatermarkQuality      = StringHelper.StrToInt(ddlWatermarkQuality.SelectedValue, 100);


            //评论
            s.CommentStatus    = chkCommentStatus.Checked ? 1 : 0;
            s.CommentOrder     = StringHelper.StrToInt(ddlCommentOrder.SelectedValue, 1);
            s.CommentApproved  = StringHelper.StrToInt(ddlCommentApproved.SelectedValue, 1);
            s.CommentSpamwords = txtCommentSpamwords.Text;

            //rss
            s.RssStatus   = chkRssStatus.Checked ? 1 : 0;
            s.RssRowCount = StringHelper.StrToInt(txtRssRowCount.Text, 20);
            s.RssShowType = StringHelper.StrToInt(ddlRssShowType.SelectedValue, 2);

            //rewrite
            //   s.RewriteStatus = chkRewriteStatus.Checked ? 1 : 0;
            s.RewriteExtension = ddlRewriteExtension.SelectedValue;

            //total
            s.SiteTotalType = StringHelper.StrToInt(ddlTotalType.SelectedValue, 1);

            s.PostShowType = StringHelper.StrToInt(ddlPostShowType.SelectedValue, 2);


            //邮件
            s.SmtpEmail      = txtSmtpEmail.Text.Trim();
            s.SmtpServer     = txtSmtpServer.Text.Trim();
            s.SmtpServerPost = StringHelper.StrToInt(txtSmtpServerPort.Text, 25);
            s.SmtpUserName   = txtSmtpUserName.Text.Trim();
            s.SmtpPassword   = txtSmtpPassword.Text.Trim();
            s.SmtpEnableSsl  = chkSmtpEnableSsl.Checked == true ? 1 : 0;

            //发送邮件设置
            s.SendMailAuthorByPost    = chkSendMailAuthorByPost.Checked == true ? 1 : 0;
            s.SendMailAuthorByComment = chkSendMailAuthorByComment.Checked == true ? 1 : 0;
            s.SendMailNotifyByComment = chkSendMailNotifyByComment.Checked == true ? 1 : 0;

            if (SettingManager.UpdateSetting())
            {
                Response.Redirect("setting.aspx?result=2");
            }
        }
    }
        public string getface(int face)
        {
            SettingInfo info = SettingManager.Select(face);

            return(info.ValueSetting.ToString());
        }
Example #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //   Response.Write(Server.UrlDecode(Request.Url.ToString()));

        if (pageType == "checkurlrewriter")
        {
            Response.Clear();
            Response.Write("支持当前设置的URL重写规则");
            Response.End();
        }

        UpdateViewCount();

        if (SettingManager.GetSetting().SiteStatus == 0)
        {
            ResponseError("网站已关闭", "网站已关闭,请与站长联系!");
        }

        themeName = SettingManager.GetSetting().Theme;
        if (RequestHelper.IsMobile)
        {
            themeName = SettingManager.GetSetting().MobileTheme;
        }
        if (!string.IsNullOrEmpty(previewThemeName))
        {
            themeName = previewThemeName;
        }
        // Response.Write("ismobile:" + RequestHelper.IsMobile + ",IsMobileDevice:" + Request.Browser.IsMobileDevice + ",BrowserType:" + Request.Browser.Type + ",UserAgent:" + Request.UserAgent + ",HTTP_ACCEPT:" + Request.ServerVariables["HTTP_ACCEPT"]);


        templatePath = Server.MapPath(string.Format("{0}/themes/{1}/template/", ConfigHelper.SitePath, themeName));

        //if (!System.IO.Directory.Exists(templatePath) && !string.IsNullOrEmpty(previewThemeName))
        //{
        //    ResponseError("预览主题不存在", "预览的主题不存在,是否修改了URL地址?");
        //}

        //非预览时
        if (!System.IO.Directory.Exists(templatePath) && string.IsNullOrEmpty(previewThemeName))
        {
            SettingInfo s = SettingManager.GetSetting();
            if (RequestHelper.IsMobile)
            {
                s.MobileTheme = "default";
            }
            else
            {
                s.Theme = "default";
            }
            themeName = "default";

            SettingManager.UpdateSetting();

            templatePath = Server.MapPath(string.Format("{0}/themes/default/template/", ConfigHelper.SitePath));
        }

        th = new TemplateHelper(templatePath);



        LoadDefault();

        LoachsDataManager loachs = new LoachsDataManager();

        th.Put("loachs", loachs);

        switch (pageType)
        {
        case "feed":
            LoadFeed();
            break;

        case "post":
            LoadPost();
            break;

        case "rsd":
            LoadRsd();
            break;

        case "wlwmanifest":
            LoadWlwmanifest();
            break;

        case "metaweblog":
            LoadMetaweblog();
            break;

        default:
            //if (IsXmlrpcPost() == true)
            //{
            //    LoadMetaweblog();
            //}
            //else
            //{
            LoadPostList();
            //    }
            break;
        }
    }
Example #14
0
        private void InitForModify()
        {
            SettingInfo entityById = SettingProvider.GetEntityById(base.OpID);

            if (entityById != null)
            {
                this.TextBox1.Text = entityById.KeyName;
                this.TextBox3.Text = entityById.KeyDesc;
                ListItem listItem = this.DropDownList5.Items.FindByValue(entityById.ControlType);
                if (listItem != null)
                {
                    listItem.Selected = true;
                }
                switch ((FieldType)System.Enum.Parse(typeof(FieldType), entityById.ControlType))
                {
                case FieldType.SingleTextType:
                    this.ShowGroup = "group1";
                    break;

                case FieldType.MultipleTextType:
                    this.ShowGroup = "group2";
                    break;

                case FieldType.MultipleHtmlType:
                    this.ShowGroup = "group7";
                    break;

                case FieldType.RadioButtonType:
                case FieldType.CheckBoxType:
                case FieldType.DropDownListType:
                    this.ShowGroup = "group3";
                    break;

                case FieldType.DateTimeType:
                    this.ShowGroup = "group6";
                    break;

                case FieldType.PictureType:
                case FieldType.FileType:
                    this.ShowGroup = "group4";
                    break;

                case FieldType.MultiPictureType:
                case FieldType.MultiFileType:
                    this.ShowGroup = "group5";
                    break;
                }
                this.TextBox6.Text     = entityById.DefaultValue;
                this.CheckBox7.Checked = entityById.IsUsing;
                this.ExtTextBox5.Text  = entityById.DataLength.ToString();
                SinGooCMS.Control.FieldSetting fieldSetting = XmlSerializerUtils.Deserialize <SinGooCMS.Control.FieldSetting>(entityById.Setting);
                if (fieldSetting != null)
                {
                    this.ExtTextBox1.Text = fieldSetting.ControlWidth.ToString();
                    this.ExtTextBox2.Text = fieldSetting.ControlHeight.ToString();
                    ListItem listItem2 = this.ExtRadioButtonList3.Items.FindByValue(fieldSetting.TextMode);
                    if (listItem2 != null)
                    {
                        listItem2.Selected = true;
                    }
                    this.ExtTextBox4.Text = fieldSetting.DataFormat;
                    ListItem listItem3 = this.ExtDropDownList6.Items.FindByValue(fieldSetting.DataFrom);
                    if (listItem3 != null)
                    {
                        listItem3.Selected = true;
                    }
                    string dataFrom = fieldSetting.DataFrom;
                    if (dataFrom != null)
                    {
                        if (!(dataFrom == "Text"))
                        {
                            if (!(dataFrom == "DataDictionary"))
                            {
                                if (!(dataFrom == "SQLQuery"))
                                {
                                    if (dataFrom == "AjaxData")
                                    {
                                        this.ExtTextBox11.Text = fieldSetting.DataSource;
                                        this.DataSource        = "AjaxData";
                                    }
                                }
                                else
                                {
                                    this.ExtTextBox9.Text = fieldSetting.DataSource;
                                    this.DataSource       = "SQLQuery";
                                }
                            }
                            else
                            {
                                this.ExtTextBox8.Text = fieldSetting.DataSource;
                                this.DataSource       = "DataDictionary";
                            }
                        }
                        else
                        {
                            this.ExtTextBox7.Text = fieldSetting.DataSource;
                            this.DataSource       = "Text";
                        }
                    }
                }
            }
        }
Example #15
0
        protected void btnok_Click(object sender, System.EventArgs e)
        {
            if (base.Action.Equals(ActionType.Add.ToString()) && !base.IsAuthorizedOp(ActionType.Add.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else if (base.Action.Equals(ActionType.Modify.ToString()) && !base.IsAuthorizedOp(ActionType.Modify.ToString()))
            {
                base.ShowMsg("Không có thẩm quyền");
            }
            else
            {
                SettingInfo settingInfo = new SettingInfo();
                if (base.IsEdit)
                {
                    settingInfo = SettingProvider.GetEntityById(base.OpID);
                }
                settingInfo.KeyName = WebUtils.GetString(this.TextBox1.Text);
                settingInfo.CateID  = ((this.cate == null) ? 0 : this.cate.AutoID);
                settingInfo.KeyDesc = WebUtils.GetString(this.TextBox3.Text);
                if (settingInfo.CateID == 0)
                {
                    base.ShowMsg("Chọn phân loại Cấu hình");
                }
                else if (string.IsNullOrEmpty(settingInfo.KeyName))
                {
                    base.ShowMsg("Cấu hình tên chủ chốt không thể để trống");
                }
                else if (string.IsNullOrEmpty(settingInfo.KeyDesc))
                {
                    base.ShowMsg("Tên hiển thị không thể để trống");
                }
                else
                {
                    settingInfo.DataLength   = WebUtils.GetInt(this.ExtTextBox5.Text, 50);
                    settingInfo.ControlType  = this.DropDownList5.SelectedValue;
                    settingInfo.DefaultValue = WebUtils.GetString(this.TextBox6.Text);
                    SinGooCMS.Control.FieldSetting fieldSetting = new SinGooCMS.Control.FieldSetting();
                    fieldSetting.ControlWidth  = WebUtils.GetInt(this.ExtTextBox1.Text);
                    fieldSetting.ControlHeight = WebUtils.GetInt(this.ExtTextBox2.Text);
                    fieldSetting.TextMode      = this.ExtRadioButtonList3.SelectedValue;
                    fieldSetting.IsDataType    = settingInfo.ControlType.Equals(FieldType.DateTimeType);
                    fieldSetting.DataFormat    = WebUtils.GetString(this.ExtTextBox4.Text);
                    FieldType fieldType = (FieldType)System.Enum.Parse(typeof(FieldType), settingInfo.ControlType);
                    switch (fieldType)
                    {
                    case FieldType.MultipleTextType:
                    case FieldType.MultipleHtmlType:
                        settingInfo.DataType = "ntext";
                        break;

                    default:
                        if (fieldType != FieldType.DateTimeType)
                        {
                            settingInfo.DataType   = "nvarchar";
                            settingInfo.DataLength = WebUtils.GetInt(this.ExtTextBox5.Text, 50);
                        }
                        else
                        {
                            settingInfo.DataType = "datetime";
                        }
                        break;
                    }
                    fieldSetting.DataFrom = this.ExtDropDownList6.SelectedValue;
                    string dataFrom = fieldSetting.DataFrom;
                    if (dataFrom != null)
                    {
                        if (!(dataFrom == "Text"))
                        {
                            if (!(dataFrom == "DataDictionary"))
                            {
                                if (!(dataFrom == "SQLQuery"))
                                {
                                    if (dataFrom == "AjaxData")
                                    {
                                        fieldSetting.DataSource = WebUtils.GetString(this.ExtTextBox11.Text);
                                    }
                                }
                                else
                                {
                                    fieldSetting.DataSource = WebUtils.GetString(this.ExtTextBox9.Text);
                                }
                            }
                            else
                            {
                                fieldSetting.DataSource = WebUtils.GetString(this.ExtTextBox8.Text);
                            }
                        }
                        else
                        {
                            fieldSetting.DataSource = this.ExtTextBox7.Text;
                        }
                    }
                    settingInfo.Setting  = XmlSerializerUtils.Serialize <SinGooCMS.Control.FieldSetting>(fieldSetting);
                    settingInfo.IsUsing  = this.CheckBox7.Checked;
                    settingInfo.IsSystem = false;
                    settingInfo.Sort     = 9999;
                    if (base.Action.Equals(ActionType.Add.ToString()))
                    {
                        if (SettingProvider.ExistsByName(settingInfo.KeyName))
                        {
                            base.ShowMsg("Cấu hình tùy chỉnh cùng tên đã tồn tại");
                            return;
                        }
                        settingInfo.AutoTimeStamp = System.DateTime.Now;
                        if (SettingProvider.Add(settingInfo) > 0)
                        {
                            CacheUtils.Del("JsonLeeCMS_CacheForGetSetting");
                            CacheUtils.Del("JsonLeeCMS_CacheForSETTINGDIRECTORY");
                            PageBase.log.AddEvent(base.LoginAccount.AccountName, "Thêm cấu hình tùy chỉnh [" + settingInfo.KeyDesc + "] thành công");
                            base.Response.Redirect(string.Concat(new object[]
                            {
                                "CustomSetting.aspx?CatalogID=",
                                base.CurrentCatalogID,
                                "&Module=",
                                base.CurrentModuleCode,
                                "&cateid=",
                                this.cate.AutoID,
                                "&action=View"
                            }));
                        }
                        else
                        {
                            base.ShowMsg("Thêm cấu hình tùy chỉnh thất bại");
                        }
                    }
                    if (base.Action.Equals(ActionType.Modify.ToString()))
                    {
                        if (SettingProvider.Update(settingInfo))
                        {
                            CacheUtils.Del("JsonLeeCMS_CacheForGetSetting");
                            CacheUtils.Del("JsonLeeCMS_CacheForSETTINGDIRECTORY");
                            PageBase.log.AddEvent(base.LoginAccount.AccountName, "Sửa đổi các cấu hình tùy chỉnh [" + settingInfo.KeyDesc + "] thành công");
                            base.Response.Redirect(string.Concat(new object[]
                            {
                                "CustomSetting.aspx?CatalogID=",
                                base.CurrentCatalogID,
                                "&Module=",
                                base.CurrentModuleCode,
                                "&cateid=",
                                this.cate.AutoID,
                                "&action=View"
                            }));
                        }
                        else
                        {
                            base.ShowMsg("Sửa đổi các cấu hình tùy chỉnh thất bại");
                        }
                    }
                }
            }
        }
Example #16
0
        public virtual async Task CreateAsync(SettingInfo settingInfo)
        {
            await _settingRepository.InsertAsync(settingInfo.ToSetting());

            await _unitOfWorkManager.Current.SaveChangesAsync();
        }
 public void AddSetting(SettingInfo infoSS)
 {
 }
Example #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="colSettings"></param>
        /// <param name="portalId"></param>
        /// <returns></returns>
        public static List <QaSettingInfo> GetUserScoringCollection(List <SettingInfo> colSettings, int portalId)
        {
            // determine if user scoring action settings exist for this portal
            var colUserScoringSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.UserScoringActionValue select t);
            var x = colUserScoringSettings.Count();

            var colScoringActions = new List <QaSettingInfo>();

            switch (colUserScoringSettings.Count())
            {
            case 0:
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AdminEntered.ToString(), Constants.DefaultScoreAdminEntered));     // static 0
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ApprovedPostEdit.ToString(), Constants.DefaultScoreApprovedPostEdit));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ApprovedTagEdit.ToString(), Constants.DefaultScoreApprovedTagEdit));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedFlaggedQuestion.ToString(), Constants.DefaultScoreAskedFlaggedQuestion));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestion.ToString(), Constants.DefaultScoreAskedQuestion));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestionVotedDown.ToString(), Constants.DefaultScoreAskedQuestionVotedDown));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestionVotedUp.ToString(), Constants.DefaultScoreAskedQuestionVotedUp));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.BountyPaid.ToString(), Constants.DefaultScoreBountyPaid));         // static 0
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.BountyReceived.ToString(), Constants.DefaultScoreBountyReceived)); // static 0
                //createtag
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.CreatedTagSynonym.ToString(), Constants.DefaultScoreCreatedTagSynonym));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.Commented.ToString(), Constants.DefaultScoreCommented));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedPost.ToString(), Constants.DefaultScoreEditedPost));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTag.ToString(), Constants.DefaultScoreEditedTag));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTagVotedDown.ToString(), Constants.DefaultScoreEditedTagVotedDown));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTagVotedUp.ToString(), Constants.DefaultScoreEditedTagVotedUp));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.FirstLoggedInView.ToString(), Constants.DefaultScoreFirstLoggedInView));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAcceptedAnswer.ToString(), Constants.DefaultScoreProvidedAcceptedAnswer));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswer.ToString(), Constants.DefaultScoreProvidedAnswer));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswerVotedDown.ToString(), Constants.DefaultScoreProvidedAnswerVotedDown));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswerVotedUp.ToString(), Constants.DefaultScoreProvidedAnswerVotedUp));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedFlaggedAnswer.ToString(), Constants.DefaultScoreProvidedFlaggedAnswer));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedDownAnswer.ToString(), Constants.DefaultScoreVotedDownAnswer));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedDownQuestion.ToString(), Constants.DefaultScoreVotedDownQuestion));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedSynonymDown.ToString(), Constants.DefaultScoreVotedSynonymDown));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedSynonymUp.ToString(), Constants.DefaultScoreVotedSynonymUp));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedTagDown.ToString(), Constants.DefaultScoreVotedTagDown));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedTagUp.ToString(), Constants.DefaultScoreVotedTagUp));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedUpAnswer.ToString(), Constants.DefaultScoreVotedUpAnswer));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedUpQuestion.ToString(), Constants.DefaultScoreVotedUpQuestion));
                colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AcceptedQuestionAnswer.ToString(), Constants.DefaultScoreAcceptedAnswer));     // new
                break;

            case 29:
                var objNewSetting = new SettingInfo
                {
                    PortalId = portalId,
                    TypeId   = (int)Constants.SettingTypes.UserScoringActionValue,
                    Key      = Constants.UserScoringActions.AcceptedQuestionAnswer.ToString(),
                    Value    = Constants.DefaultScoreAcceptedAnswer.ToString()
                };

                var cntQa = new DnnqaController();
                cntQa.UpdateQaPortalSetting(objNewSetting);

                DataCache.RemoveCache(Constants.ModuleCacheKey + Constants.QaSettingsCacheKey + portalId);

                colUserScoringSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.UserScoringActionValue select t);
                colScoringActions.AddRange(colUserScoringSettings.Select(objSetting => BuildUserScore(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                break;

            default:
                colScoringActions.AddRange(colUserScoringSettings.Select(objSetting => BuildUserScore(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                break;
            }

            return(colScoringActions);
        }
Example #19
0
        /// <summary>
        /// 读取配置
        /// </summary>
        /// <param name="setPath">配置文件路径</param>
        /// <param name="info">配置信息的结构</param>
        public static void ReadSetting(this string setPath, out SettingInfo info)
        {
            if (File.Exists(setPath))
            {
                var data = XElement.Load(setPath);

                info.Boot = data.Element("Boot").Value.ToLower() == "true" ? true : false;
                info.SysRightMenu = data.Element("RightMenu").Value.ToLower() == "true" ? true : false;
                info.HotKey = data.Element("HotKey").Value.ToLower();
                info.BackImg = data.Element("BackImg").Value;
                info.SendBug = data.Element("SendBug").Value.ToLower() == "true" ? true : false;
            }
            else
            {
                info = MyWork.DefaultSettingInfo;
                MyWork.DefaultSettingInfo.SaveToConfig(MyWork.ConfigPath);
            }
        }
Example #20
0
    /// <summary>
    /// 绑定
    /// </summary>
    protected void BindSetting()
    {
        LoadDefaultData();

        SettingInfo s = SettingManager.GetSetting();

        if (s != null)
        {
            txtSiteName.Text        = StringHelper.HtmlDecode(s.SiteName);
            txtSiteDescription.Text = StringHelper.HtmlDecode(s.SiteDescription);
            txtMetaKeywords.Text    = StringHelper.HtmlDecode(s.MetaKeywords);
            txtMetaDescription.Text = StringHelper.HtmlDecode(s.MetaDescription);

            chkSiteStatus.Checked = s.SiteStatus == 1 ? true : false;


            chkEnableVerifyCode.Checked = s.EnableVerifyCode == 1 ? true : false;


            txtSidebarPostCount.Text    = s.SidebarPostCount.ToString();
            txtSidebarCommentCount.Text = s.SidebarCommentCount.ToString();
            txtSidebarTagCount.Text     = s.SidebarTagCount.ToString();

            txtPageSizeCommentCount.Text = s.PageSizeCommentCount.ToString();
            txtPageSizePostCount.Text    = s.PageSizePostCount.ToString();
            //    txtPageSizeTagCount.Text = s.PageSizeTagCount.ToString();

            txtPostRelatedCount.Text = s.PostRelatedCount.ToString();

            txtFooterHtml.Text = s.FooterHtml;

            // ddlRewriteExtension.SelectedValue = s.RewriteExtension;

            //chkCommentApproved.Checked = s.CommentApproved == 1 ? true : false;

            //水印
            ddlWatermarkType.SelectedValue         = s.WatermarkType.ToString();
            txtWatermarkText.Text                  = s.WatermarkText;
            ddlWatermarkFontName.SelectedValue     = s.WatermarkFontName;
            ddlWatermarkFontSize.SelectedValue     = s.WatermarkFontSize.ToString();
            txtWatermarkImage.Text                 = s.WatermarkImage;
            ddlWatermarkTransparency.SelectedValue = s.WatermarkTransparency.ToString();
            ddlWatermarkPosition.SelectedValue     = s.WatermarkPosition.ToString();
            ddlWatermarkQuality.SelectedValue      = s.WatermarkQuality.ToString();

            //评论
            chkCommentStatus.Checked         = s.CommentStatus == 1 ? true : false;
            ddlCommentOrder.SelectedValue    = s.CommentOrder.ToString();
            ddlCommentApproved.SelectedValue = s.CommentApproved.ToString();
            txtCommentSpamwords.Text         = s.CommentSpamwords;

            //rss
            chkRssStatus.Checked         = s.RssStatus == 1 ? true : false;
            txtRssRowCount.Text          = s.RssRowCount.ToString();
            ddlRssShowType.SelectedValue = s.RssShowType.ToString();

            //rewrite
            //   chkRewriteStatus.Checked = s.RewriteStatus == 1 ? true : false;
            ddlRewriteExtension.SelectedValue = s.RewriteExtension;

            //total
            ddlTotalType.SelectedValue = s.SiteTotalType.ToString();

            ddlPostShowType.SelectedValue = s.PostShowType.ToString();

            //邮件
            txtSmtpEmail.Text        = s.SmtpEmail;
            txtSmtpServer.Text       = s.SmtpServer;
            txtSmtpServerPort.Text   = s.SmtpServerPost.ToString();
            txtSmtpUserName.Text     = s.SmtpUserName;
            txtSmtpPassword.Text     = s.SmtpPassword;
            chkSmtpEnableSsl.Checked = s.SmtpEnableSsl == 1 ? true : false;

            //发送邮件设置
            chkSendMailAuthorByPost.Checked    = s.SendMailAuthorByPost == 1 ? true : false;
            chkSendMailAuthorByComment.Checked = s.SendMailAuthorByComment == 1 ? true : false;
            chkSendMailNotifyByComment.Checked = s.SendMailNotifyByComment == 1 ? true : false;
        }
    }
Example #21
0
 public async Task CreateAsync(SettingInfo <int, long> setting)
 {
     _settings.Add(setting);
 }
Example #22
0
    void Start()
    {
        xayaClient              = GetComponent <XAYAClient>();
        shipsdClient            = GetComponent <ShipSDClient>();
        GlobalData.gErrorBox    = errorPopup;
        GlobalData.gErrorText   = errorText;
        GlobalData.gSettingInfo = SettingInfo.getSettingFromJson();
        //============ get user info from cookie ========================//
        Debug.Log(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData));
        if (File.Exists(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\xaya\\.cookie"))
        {
            string   cookieStr = File.ReadAllText(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + "\\xaya\\.cookie");
            string[] userInfo  = cookieStr.Split(':');
            if (userInfo != null && userInfo.Length > 1)
            {
                GlobalData.gSettingInfo.rpcUserName     = userInfo[0];
                GlobalData.gSettingInfo.rpcUserPassword = userInfo[1];
            }
        }
        //===============================================================//

        inputXayaURL.text         = GlobalData.gSettingInfo.xayaURL;
        inputRpcUserName.text     = GlobalData.gSettingInfo.rpcUserName;
        inputRpcUserPassword.text = GlobalData.gSettingInfo.rpcUserPassword;
        inputGSPIP.text           = GlobalData.gSettingInfo.GSPIP;

        //---------------------------------------------//
        if (shipsdClient.IsRunningGSPServer())
        {
            checkLocalGSP.isOn = true;
            checkLocalGSP.transform.GetChild(0).GetChild(0).gameObject.SetActive(true);
        }

        //------------- check running xayad-------------------------//

/*
 *      bool running = false;
 *
 *          try
 *          {
 *          foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName("xayad"))
 *          {
 *              running = true;
 *          }
 #if UNITY_STANDALONE_LINUX
 *          foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName("xaya-qt"))
 *          {
 *              running = true;
 *          }
 *          foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcessesByName("./xaya-qt"))
 *          {
 *              running = true;
 *          }
 #endif
 *      }
 *      catch
 *      {
 *
 *
 *      }
 *
 *      if (!running)
 *      {
 *          GlobalData.ErrorPopup("Xaya Service is not running.\nYou must run xaya and restart application.");
 *          errorCloseBtn.GetComponent<Button>().onClick.AddListener(delegate {
 *              UnityEngine.SceneManagement.SceneManager.UnloadScene(0);
 *              Application.Quit();
 *          });
 *          //new WaitForSeconds(2);
 *
 *      }
 */
        //----------------------------------------------------------//
        //---------------- Kill live Channel-----------------------------//
        GetComponent <GameChannelManager>().KillIsChannel();
    }
Example #23
0
 public AdminPage()
 {
     CheckLoginAndPermission();
     setting = SettingManager.GetSetting();
 }
Example #24
0
 public Task CreateAsync(SettingInfo setting)
 {
     _settings.Add(setting.ToSetting());
     return(_context.SaveChangesAsync());
 }
Example #25
0
 #pragma warning disable 1998
 public async Task DeleteAsync(SettingInfo setting)
 {
     settings.RemoveAll(s => s.TenantId == setting.TenantId && s.UserId == setting.UserId && s.Name == setting.Name);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="colSettings"></param>
        /// <param name="portalId"></param>
        /// <returns></returns>
        public static List<QaSettingInfo> GetUserScoringCollection(List<SettingInfo> colSettings, int portalId)
        {
            // determine if user scoring action settings exist for this portal
            var colUserScoringSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.UserScoringActionValue select t);
            var x = colUserScoringSettings.Count();

            var colScoringActions = new List<QaSettingInfo>();

            switch (colUserScoringSettings.Count())
            {
                case 0:
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AdminEntered.ToString(), Constants.DefaultScoreAdminEntered)); // static 0
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ApprovedPostEdit.ToString(), Constants.DefaultScoreApprovedPostEdit));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ApprovedTagEdit.ToString(), Constants.DefaultScoreApprovedTagEdit));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedFlaggedQuestion.ToString(), Constants.DefaultScoreAskedFlaggedQuestion));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestion.ToString(), Constants.DefaultScoreAskedQuestion));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestionVotedDown.ToString(), Constants.DefaultScoreAskedQuestionVotedDown));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AskedQuestionVotedUp.ToString(), Constants.DefaultScoreAskedQuestionVotedUp));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.BountyPaid.ToString(), Constants.DefaultScoreBountyPaid)); // static 0
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.BountyReceived.ToString(), Constants.DefaultScoreBountyReceived)); // static 0
                    //createtag
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.CreatedTagSynonym.ToString(), Constants.DefaultScoreCreatedTagSynonym));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.Commented.ToString(), Constants.DefaultScoreCommented));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedPost.ToString(), Constants.DefaultScoreEditedPost));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTag.ToString(), Constants.DefaultScoreEditedTag));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTagVotedDown.ToString(), Constants.DefaultScoreEditedTagVotedDown));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.EditedTagVotedUp.ToString(), Constants.DefaultScoreEditedTagVotedUp));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.FirstLoggedInView.ToString(), Constants.DefaultScoreFirstLoggedInView));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAcceptedAnswer.ToString(), Constants.DefaultScoreProvidedAcceptedAnswer));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswer.ToString(), Constants.DefaultScoreProvidedAnswer));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswerVotedDown.ToString(), Constants.DefaultScoreProvidedAnswerVotedDown));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedAnswerVotedUp.ToString(), Constants.DefaultScoreProvidedAnswerVotedUp));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.ProvidedFlaggedAnswer.ToString(), Constants.DefaultScoreProvidedFlaggedAnswer));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedDownAnswer.ToString(), Constants.DefaultScoreVotedDownAnswer));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedDownQuestion.ToString(), Constants.DefaultScoreVotedDownQuestion));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedSynonymDown.ToString(), Constants.DefaultScoreVotedSynonymDown));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedSynonymUp.ToString(), Constants.DefaultScoreVotedSynonymUp));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedTagDown.ToString(), Constants.DefaultScoreVotedTagDown));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedTagUp.ToString(), Constants.DefaultScoreVotedTagUp));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedUpAnswer.ToString(), Constants.DefaultScoreVotedUpAnswer));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.VotedUpQuestion.ToString(), Constants.DefaultScoreVotedUpQuestion));
                    colScoringActions.Add(BuildUserScore(Constants.UserScoringActions.AcceptedQuestionAnswer.ToString(), Constants.DefaultScoreAcceptedAnswer)); // new
                    break;
                case 29:
                    var objNewSetting = new SettingInfo
                    {
                        PortalId = portalId,
                        TypeId = (int)Constants.SettingTypes.UserScoringActionValue,
                        Key = Constants.UserScoringActions.AcceptedQuestionAnswer.ToString(),
                        Value = Constants.DefaultScoreAcceptedAnswer.ToString()
                    };

                    var cntQa = new SettingController();
                    cntQa.UpdateSetting(objNewSetting);

                    DataCache.RemoveCache(Constants.ModuleCacheKey + Constants.QaSettingsCacheKey + portalId);

                    colUserScoringSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.UserScoringActionValue select t);
                    colScoringActions.AddRange(colUserScoringSettings.Select(objSetting => BuildUserScore(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                    break;
                default:
                    colScoringActions.AddRange(colUserScoringSettings.Select(objSetting => BuildUserScore(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                    break;
            }

            return colScoringActions;
        }
Example #27
0
 public int AddSetting(SettingInfo objSetting)
 {
     return(dataProvider.AddSetting(objSetting.Description, objSetting.Attachments, objSetting.Emoticons, objSetting.Html, objSetting.PostIcon, objSetting.Rss, objSetting.Scripts, objSetting.Moderated, objSetting.AutoTrustLevel, objSetting.AttachMaxCount, objSetting.AttachMaxSize, objSetting.AttachAutoResize, objSetting.AttachMaxHeight, objSetting.AttachMaxWidth, objSetting.AttachStore, objSetting.EditorType, objSetting.EditorHeight, objSetting.EditorWidth, objSetting.Filters));
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="colSettings"></param>
        /// <param name="portalId"></param>
        /// <returns></returns>
        public static List<QaSettingInfo> GetOpThresholdCollection(List<SettingInfo> colSettings, int portalId)
        {
            // determine if operational threshold settings exist for this portal
            var colOpThreshSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.OperationalThresholds select t);
            var colOpThresholds = new List<QaSettingInfo>();

            switch (colOpThreshSettings.Count())
            {
                case 0:

                    //todo Add New default values to database
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.PostChangeVoteWindowMinutes.ToString(), Constants.DefaultOpPostChangeVoteWindowMinutes));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.PostFlagCompleteCount.ToString(), Constants.DefaultOpPostFlagCompleteCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.PostFlagWindowHours.ToString(), Constants.DefaultOpPostFlagWindowHours));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.QuestionCloseCompleteVoteCount.ToString(), Constants.DefaultOpQuestionCloseCompleteVoteCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.QuestionCloseWindowDays.ToString(), Constants.DefaultOpQuestionCloseWindowDays));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.QuestionFlagHomeRemoveCount.ToString(), Constants.DefaultOpQuestionFlagHomeRemoveCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TagCloseWindowDays.ToString(), Constants.DefaultOpTagCloseWindowDays));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TagFlagCompleteCount.ToString(), Constants.DefaultOpTagFlagCompleteCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TagFlagWindowHours.ToString(), Constants.DefaultOpTagFlagWindowHours));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TermSynonymApproveCount.ToString(), Constants.DefaultOpTermSynonymApproveCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TermSynonymRejectCount.ToString(), Constants.DefaultOpTermSynonymRejectCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.TermSynonymMaxCount.ToString(), Constants.DefaultOpTermSynonymMaxCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserCloseVoteCount.ToString(), Constants.DefaultOpUserCloseVoteCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserFlagPostModerateCount.ToString(), Constants.DefaultOpUserFlagPostModerateCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserFlagPostSpamCount.ToString(), Constants.DefaultOpUserFlagPostSpamCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserTermSynonymCreateMinAnswerCount.ToString(), Constants.DefaultOpUserTermSynonymCreateMinAnswerCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserTermSynonymVoteMinAnswerScoreCount.ToString(), Constants.DefaultOpUserTermSynonymVoteMinAnswerScoreCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserUpVoteAnswerCount.ToString(), Constants.DefaultOpUserUpVoteAnswerCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.UserUpVoteQuestionCount.ToString(), Constants.DefaultOpUserUpVoteQuestionCount));
                    //colOpThresholds.Add(BuildOpThreshold(Constants.OpThresholds.QuestionHomeMinScore.ToString(), Constants.DefaultOpHomeQuestionMinScore));
                    break;
                case 19:
                    var objNewSetting = new SettingInfo
                    {
                        PortalId = portalId,
                        TypeId = (int)Constants.SettingTypes.OperationalThresholds,
                        Key = Constants.OpThresholds.QuestionHomeMinScore.ToString(),
                        Value = Constants.DefaultOpHomeQuestionMinScore.ToString()
                    };

                    var cntQa = new SettingController();
                    cntQa.UpdateSetting(objNewSetting);

                    DataCache.RemoveCache(Constants.ModuleCacheKey + Constants.QaSettingsCacheKey + portalId);

                    colOpThreshSettings = (from t in colSettings where t.TypeId == (int)Constants.SettingTypes.OperationalThresholds select t);
                    colOpThresholds.AddRange(colOpThreshSettings.Select(objSetting => BuildOpThreshold(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                    break;
                default :
                    colOpThresholds.AddRange(colOpThreshSettings.Select(objSetting => BuildOpThreshold(objSetting.Key, Convert.ToInt32(objSetting.Value))));
                    break;
            }

            return colOpThresholds;
        }
Example #29
0
 public async Task CreateAsync(SettingInfo setting)
 {
     _settings.Add(setting);
 }
Example #30
0
 private Setting(SettingInfo settingInfo)
 {
     _settingInfo = settingInfo;
 }
Example #31
0
 /// <summary>
 /// Creates new <see cref="Setting"/> object from given <see cref="SettingInfo"/> object.
 /// </summary>
 public static Setting ToSetting(this SettingInfo settingInfo)
 {
     return(settingInfo == null
         ? null
         : new Setting(settingInfo.TenantId, settingInfo.UserId, settingInfo.Name, settingInfo.Value));
 }
Example #32
0
        public string GetHotline(int key)
        {
            SettingInfo info = SettingManager.Select(key);

            return(info.ValueSetting.ToString());
        }
Example #33
0
 public void Create(SettingInfo setting)
 {
     _settings.Add(setting);
 }
Example #34
0
 public void AddSetting(SettingInfo infoSS)
 {
 }
Example #35
0
        private void SetData()
        {
            try
            {
                string[] settingList = new string[] { "General", "Shortcuts", "About CtrlCVMaster" };

                SettingInfoList settingInfoList = new SettingInfoList();
                foreach (string settingName in settingList)
                {
                    SettingInfo settingInfo = new SettingInfo();
                    settingInfo.SETTINGNAME = settingName;
                    settingInfoList.Add(settingInfo);
                }

                this.gridCtrl.DataSource = settingInfoList;
            }
            catch (Exception ex)
            {
                ConsoleLib.ConsoleLib.WriteFormatted(ex.ToString() + "                    ", t);
                ConsoleLib.ConsoleLib.WriteLine(Environment.NewLine);
            }
        }
Example #36
0
 public void UpdateSetting(SettingInfo infoSS)
 {
 }
 public void UpdateSetting(SettingInfo infoSS)
 {
 }
		public int AddSetting(SettingInfo objSetting)
		{
			return dataProvider.AddSetting(objSetting.Description, objSetting.Attachments, objSetting.Emoticons, objSetting.Html, objSetting.PostIcon, objSetting.Rss, objSetting.Scripts, objSetting.Moderated,objSetting.AutoTrustLevel,objSetting.AttachMaxCount,objSetting.AttachMaxSize,objSetting.AttachAutoResize,objSetting.AttachMaxHeight,objSetting.AttachMaxWidth, objSetting.AttachStore, objSetting.EditorType, objSetting.EditorHeight, objSetting.EditorWidth, objSetting.Filters);
		}
		public void UpdateSetting(SettingInfo objSetting)
		{
			dataProvider.UpdateSetting(objSetting.SettingId, objSetting.Description, objSetting.Attachments, objSetting.Emoticons, objSetting.Html, objSetting.PostIcon, objSetting.Rss, objSetting.Scripts, objSetting.Moderated, objSetting.AutoTrustLevel, objSetting.AttachMaxCount, objSetting.AttachMaxSize, objSetting.AttachAutoResize, objSetting.AttachMaxHeight, objSetting.AttachMaxWidth, objSetting.AttachStore, objSetting.EditorType, objSetting.EditorHeight, objSetting.EditorWidth, objSetting.Filters);
			//Caching.ClearSettingsCache();
		}
 private void LoadUserSettingInfos()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetUserSettingList;
         webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add("310202");
         webRequest.ListData.Add(string.Empty);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string          strInfo   = webReturn.ListData[i];
             OperationReturn optReturn = XMLHelper.DeserializeObject <SettingInfo>(strInfo);
             if (!optReturn.Result)
             {
                 CurrentApp.WriteLog("LoadSetting", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 continue;
             }
             SettingInfo settingInfo = optReturn.Data as SettingInfo;
             if (settingInfo == null)
             {
                 CurrentApp.WriteLog("LoadSetting", string.Format("Fail.\tSettingInfo is null"));
                 continue;
             }
             var temp =
                 mListSettingInfos.FirstOrDefault(
                     s => s.ParamID == settingInfo.ParamID && s.UserID == settingInfo.UserID);
             if (temp == null)
             {
                 mListSettingInfos.Add(settingInfo);
             }
             else
             {
                 mListSettingInfos.Remove(temp);
                 mListSettingInfos.Add(settingInfo);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }