本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.UpdateModuleSetting方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.UpdateModuleSetting方法的具体用法?C# ModuleController.UpdateModuleSetting怎么用?C# ModuleController.UpdateModuleSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Modules.ModuleController
的用法示例。
在下文中一共展示了ModuleController.UpdateModuleSetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveSettings
protected void SaveSettings()
{
ModuleController mc = new ModuleController();
if (txtAnalyticsTrackingId.Text.Length > 0)
{
if (ModuleSettings.ContainsKey("GoogleTrackingId"))
ModuleSettings["GoogleTrackingId"] = txtAnalyticsTrackingId.Text;
else
ModuleSettings.Add("GoogleTrackingId", txtAnalyticsTrackingId.Text);
mc.UpdateModuleSetting(this.ModuleId, "GoogleTrackingId", txtAnalyticsTrackingId.Text);
}
if (ModuleSettings.ContainsKey("LocalHostAddress"))
ModuleSettings["LocalHostAddress"] = txtLocalHostName.Text;
else
ModuleSettings.Add("LocalHostAddress", txtLocalHostName.Text );
mc.UpdateModuleSetting(this.ModuleId, "LocalHostAddress", txtLocalHostName.Text );
if (ddlSecurityGroups.SelectedValue != "-1")
{
if (ModuleSettings.ContainsKey("HideTrackingFromRole"))
ModuleSettings["HideTrackingFromRole"] = ddlSecurityGroups.SelectedItem.Text;
else
ModuleSettings.Add("HideTrackingFromRole", ddlSecurityGroups.SelectedItem.Text);
mc.UpdateModuleSetting(this.ModuleId, "HideTrackingFromRole", ddlSecurityGroups.SelectedItem.Text);
}
else
{
if (ModuleSettings.ContainsKey("HideTrackingFromRole"))
mc.DeleteModuleSetting(this.ModuleId, "HideTrackingFromRole");
}
}
示例2: lnkSave_OnClick
protected void lnkSave_OnClick(object sender, EventArgs e)
{
try
{
var moduleController = new ModuleController();
moduleController.UpdateModuleSetting(ModuleId, "Enabled", chkEnabled.Checked.ToString());
moduleController.UpdateModuleSetting(ModuleId, "InstrumentationKey", txtInstrumentationKey.Text.Trim());
txtInstrumentationKey.Enabled = chkEnabled.Checked;
rqInstrumentationKey.Enabled = txtInstrumentationKey.Enabled;
// Update the configuration files
ModifyLog4NetConfigFile(!chkEnabled.Checked);
ModifyAppInsightsConfigFile(!chkEnabled.Checked);
ModifyAppInsightsJsFile(!chkEnabled.Checked);
ModifyWebConfigFile(!chkEnabled.Checked);
// Increment the CRM version to avoid appinsights.js caching
HostController.Instance.IncrementCrmVersion(true);
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
示例3: UpdateSettings
public override void UpdateSettings()
{
try
{
// actions here
ModuleController mc = new ModuleController();
mc.UpdateModuleSetting(ModuleId, "emailTo", aan.Text);
mc.UpdateModuleSetting(ModuleId, "emailCC", cc.Text);
mc.UpdateModuleSetting(ModuleId, "emailBCC", bcc.Text);
mc.UpdateModuleSetting(ModuleId, "emailFROM", from.Text);
mc.UpdateModuleSetting(ModuleId, "emailFROMNAME", fromname.Text);
//refresh cache
ModuleController.SynchronizeModule(ModuleId);
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
finally
{
DataCache.ClearPortalCache(PortalId, false);
}
}
示例4: cmdSave_Click
protected void cmdSave_Click(object sender, EventArgs e)
{
ModuleController mc = new ModuleController();
mc.UpdateModuleSetting(ModuleId, "template", scriptList.SelectedValue);
mc.UpdateModuleSetting(ModuleId, "data", HiddenField.Value);
Response.Redirect(Globals.NavigateURL(), true);
//DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "Update Successful", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess);
}
示例5: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
objModules.UpdateModuleSetting(ModuleId, "SQLQuery", txtSqlQuery.Text);
objModules.UpdateModuleSetting(ModuleId, "SQLTemplate", txtTemplate.Text);
objModules.UpdateModuleSetting(ModuleId, "SQLItemTemplate", txtItemTemplate.Text);
objModules.UpdateModuleSetting(ModuleId, "SQLRowTemplate", txtRowTemplate.Text);
Response.Redirect(PortalSettings.ActiveTab.FullUrl.ToLower().Replace(System.Globalization.CultureInfo.CurrentUICulture.Name.ToLower() + "/", ""));
}
示例6: UpdateSettings
public override void UpdateSettings()
{
base.UpdateSettings();
PortalController.UpdatePortalSetting(ModuleContext.PortalId, "EnableUrlLanguage", chkUrl.Checked.ToString());
var modController = new ModuleController();
modController.UpdateModuleSetting(ModuleContext.ModuleId, "UsePaging", chkUsePaging.Checked.ToString());
modController.UpdateModuleSetting(ModuleContext.ModuleId, "PageSize", txtPageSize.Text);
}
示例7: UpdateSettings
public override void UpdateSettings()
{
base.UpdateSettings();
//
ModuleController mc = new ModuleController();
mc.UpdateModuleSetting(ModuleId, "WidthSlide", txtWidth.Text);
mc.UpdateModuleSetting(ModuleId, "HeightSlide", txtHeight.Text);
}
示例8: UpdateSettings
public override void UpdateSettings()
{
base.UpdateSettings();
var modController = new ModuleController();
modController.UpdateModuleSetting(ModuleContext.ModuleId, "UsePaging", chkUsePaging.Checked.ToString());
modController.UpdateModuleSetting(ModuleContext.ModuleId, "PageSize", txtPageSize.Text);
modController.UpdateModuleSetting(ModuleContext.ModuleId, "ShowLanguages", chkShowLanguages.Checked.ToString());
modController.UpdateModuleSetting(ModuleContext.ModuleId, "ShowSettings", chkShowSettings.Checked.ToString());
}
示例9: SaveSettings
public override void SaveSettings()
{
QueryStringParameterEditor.SavePendingEdits(this);
var objModules = new ModuleController();
objModules.UpdateModuleSetting(ModuleId, Setting.SourceUrl, ctlUrlxml.Text);
objModules.UpdateModuleSetting(ModuleId, Setting.UrlEncoding, rblQueryStringEncoding.SelectedValue);
objModules.UpdateModuleSetting(ModuleId, Setting.SourceAccount, txtAccount.Text);
if (txtPassword.Text != FakePasswordTemplate ) objModules.UpdateModuleSetting(ModuleId, Setting.SourcePassWord, txtPassword.Text);
objModules.UpdateModuleSetting(ModuleId, Setting.EnableCache, cbxCaching.Checked.ToString());
}
示例10: IsNewModuleInstance
public bool IsNewModuleInstance()
{
var settings = ModuleContext.Settings;
var mc = new ModuleController();
var minSettings = 0;
if (settings.ContainsKey(SettingName.ExcludeFromSearch)) minSettings++;
if (settings.ContainsKey(SettingName.CalculatedColumnsRenderExpressionInForm)) minSettings++;
if (settings.ContainsKey(SettingName.UseButtonsInForm)) minSettings++;
if (settings.Count > minSettings) return false;
mc.UpdateModuleSetting( ModuleId,SettingName.UseButtonsInForm, bool.TrueString );
mc.UpdateModuleSetting(ModuleId, SettingName.ExcludeFromSearch, bool.TrueString);
mc.UpdateModuleSetting(ModuleId, SettingName.CalculatedColumnsRenderExpressionInForm, bool.TrueString);
return true;
}
示例11: UpdateSettings
public override void UpdateSettings()
{
try
{
var settings = new ModuleController();
settings.UpdateModuleSetting(this.ModuleId, ModuleSettingsNames.BlockedRole, txtRoles.Text);
settings.UpdateModuleSetting(this.ModuleId, ModuleSettingsNames.SessionObject, txtSessionStateToClear.Text);
ModuleController.SynchronizeModule(this.ModuleId);
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
示例12: Login_Input
protected int Login_Input()
{
UserLoginStatus loginStatus = new UserLoginStatus();
UserInfo objUserInfo = UserController.ValidateUser(PortalId, tbUsername.Text, tbPassword.Text, "", PortalSettings.PortalName, Request.UserHostAddress, ref loginStatus);
if (loginStatus == UserLoginStatus.LOGIN_SUCCESS || loginStatus == UserLoginStatus.LOGIN_SUPERUSER)
{
UserController.UserLogin(PortalId, objUserInfo, PortalSettings.PortalName, Request.UserHostAddress, false);
if (cbRemember.Checked)
{
// Set settings
int random = new Random().Next();
ModuleController obModule = new ModuleController();
obModule.UpdateModuleSetting(ModuleId, tbUsername.Text, random.ToString());
// Set cookie
HttpCookie obCookie = new HttpCookie(cookie_name());
obCookie.Value = string.Format("{0}_{1}", random, tbUsername.Text);
obCookie.Expires = DateTime.Today.AddMonths(3);
Response.Cookies.Add(obCookie);
obCookie = new HttpCookie("EOFFICE");
obCookie.Value = Request.ApplicationPath;
obCookie.Expires = DateTime.Today.AddYears(1);
obCookie.HttpOnly = false;
Response.Cookies.Add(obCookie);
}
return 1;
}
else
{
lbError.Text = "Tên đăng nhập hoặc Mật khẩu không chính xác";
return 0;
}
}
示例13: UpdateModuleSettingForAllLanguages
/// <summary>
/// Update a setting for all language-versions of a module
/// </summary>
public static void UpdateModuleSettingForAllLanguages(int moduleId, string key, string value)
{
var moduleController = new ModuleController();
// Find this module in other languages and update contentGroupGuid
var originalModule = moduleController.GetModule(moduleId);
var languages = LocaleController.Instance.GetLocales(originalModule.PortalID);
if (!originalModule.IsDefaultLanguage && originalModule.DefaultLanguageModule != null)
originalModule = originalModule.DefaultLanguageModule;
foreach (var language in languages)
{
// Find module for given Culture
var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID, originalModule.TabID, originalModule.PortalID, language.Value);
// Break if no module found
if (moduleByCulture == null)
continue;
if (value == null)
moduleController.DeleteModuleSetting(moduleByCulture.ModuleID, key);
else
moduleController.UpdateModuleSetting(moduleByCulture.ModuleID, key, value);
}
}
示例14: UpdateSettings
public override void UpdateSettings()
{
ModuleController settings = new ModuleController();
settings.UpdateModuleSetting(ModuleId, ModuleSettingNames.MySetting1, txtMySetting1.Text);
//refresh cache
ModuleController.SynchronizeModule(ModuleId);
}
示例15: SaveSettings
public override void SaveSettings()
{
if (Page.IsValid & UrlAccessIsPermitted)
{
PedXsl.SavePendingEdits(this);
// Update settings in the database
var objModules = new ModuleController();
objModules.UpdateModuleSetting(ModuleId, Setting.TransUrl, UrlXsl.Url);
}
}