public ActionResult Upload(UploadModel model) { if (ModelState.IsValid) { SiteConfigInfo siteConfigInfo = BSConfig.SiteConfig; siteConfigInfo.UploadImgType = model.UploadImgType; siteConfigInfo.UploadImgSize = model.UploadImgSize * 1000; siteConfigInfo.UploadAttType = model.UploadAttType; siteConfigInfo.UploadAttSize = model.UploadAttSize * 1000; siteConfigInfo.WatermarkType = model.WatermarkType; siteConfigInfo.WatermarkQuality = model.WatermarkQuality; siteConfigInfo.WatermarkPosition = model.WatermarkPosition; siteConfigInfo.WatermarkImg = model.WatermarkImg == null ? "" : model.WatermarkImg; siteConfigInfo.WatermarkImgOpacity = model.WatermarkImgOpacity; siteConfigInfo.WatermarkText = model.WatermarkText == null ? "" : model.WatermarkText; siteConfigInfo.WatermarkTextFont = model.WatermarkTextFont; siteConfigInfo.WatermarkTextSize = model.WatermarkTextSize; siteConfigInfo.ArticleImgThumbSize = model.ArticleImgThumbSize; siteConfigInfo.FriendLinkThumbSize = model.FriendLinkThumbSize; siteConfigInfo.ArticleClassThumbSize = model.ArticleClassThumbSize; siteConfigInfo.SpecialImgThumbSize = model.SpecialImgThumbSize; siteConfigInfo.UserAvatarThumbSize = model.UserAvatarThumbSize; siteConfigInfo.UserRankAvatarThumbSize = model.UserRankAvatarThumbSize; BSConfig.SaveSiteConfig(siteConfigInfo); //Emails.ResetShop(); //SMSes.ResetShop(); AddAdminOperateLog("修改上传设置"); return(PromptView(Url.Action("upload"), "修改上传设置成功")); } LoadFont(); return(View(model)); }
public override ILearnAlgorithmConf getConf(int CountFeatures) { BSConfig conf = new BSConfig(); conf.Init(CountFeatures); return(conf); }
public virtual void Init(ILearnAlgorithmConf conf) { config = conf as BSConfig; iter = ((BSConfig)conf).iter; N = ((BSConfig)conf).N; m = ((BSConfig)conf).m; F = ((BSConfig)conf).F; p_one = ((BSConfig)conf).p_one; p_one_center = ((BSConfig)conf).p_one_center; p_two_center = ((BSConfig)conf).p_two_center; p = ((BSConfig)conf).p; }
public void ReportStateToCS(NetSessionBase session) { Protos.BS2CS_ReportState reportState = ProtoCreator.Q_BS2CS_ReportState(); BSConfig config = BS.instance.config; reportState.BsInfo = new Protos.BSInfo { Id = config.id, Ip = config.externalIP, Port = config.externalPort, State = (Protos.BSInfo.Types.State)BS.instance.state }; session.Send(reportState); }
public ActionResult Site(SetModel model) { if (ModelState.IsValid) { SiteConfigInfo siteCofnigInfo = BSConfig.SiteConfig; siteCofnigInfo.SiteName = model.SiteName == null ? "" : model.SiteName; siteCofnigInfo.SiteUrl = model.SiteUrl == null ? "" : model.SiteUrl; siteCofnigInfo.SiteTitle = model.SiteTitle == null ? "" : model.SiteTitle; siteCofnigInfo.SEOKeyword = model.SEOKeyword == null ? "" : model.SEOKeyword; siteCofnigInfo.SEODescription = model.SEODescription == null ? "" : model.SEODescription; siteCofnigInfo.ICP = model.ICP == null ? "" : model.ICP; siteCofnigInfo.Script = model.Script == null ? "" : model.Script; siteCofnigInfo.IsLicensed = model.IsLicensed; BSConfig.SaveSiteConfig(siteCofnigInfo); return(PromptView(Url.Action("site"), "修改站点信息成功")); } return(View(model)); }