本文整理汇总了C#中mojoPortal.Business.Module.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Module.Save方法的具体用法?C# Module.Save怎么用?C# Module.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mojoPortal.Business.Module
的用法示例。
在下文中一共展示了Module.Save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnCreateNewContent_Click
protected void btnCreateNewContent_Click(object sender, EventArgs e)
{
Page.Validate("contentcatalog");
if (!Page.IsValid) { return; }
int moduleDefID = int.Parse(ddModuleType.SelectedItem.Value, CultureInfo.InvariantCulture);
ModuleDefinition moduleDefinition = new ModuleDefinition(moduleDefID);
Module module = new Module();
module.ModuleTitle = this.txtModuleTitle.Text;
module.ModuleDefId = moduleDefID;
module.FeatureGuid = moduleDefinition.FeatureGuid;
module.Icon = moduleDefinition.Icon;
module.SiteId = siteSettings.SiteId;
module.SiteGuid = siteSettings.SiteGuid;
module.CreatedByUserId = SiteUtils.GetCurrentSiteUser().UserId;
module.CacheTime = moduleDefinition.DefaultCacheTime;
module.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
module.HeadElement = WebConfigSettings.ModuleTitleTag;
module.Save();
WebUtils.SetupRedirect(this, SiteRoot
+ "/Admin/ContentManagerPreview.aspx?mid="
+ module.ModuleId.ToInvariantString()
);
}
示例2: btnCreateNewContent_Click
private void btnCreateNewContent_Click(Object sender, EventArgs e)
{
Page.Validate("pagelayout");
if (!Page.IsValid) { return; }
int moduleDefID = int.Parse(moduleType.SelectedItem.Value);
ModuleDefinition moduleDefinition = new ModuleDefinition(moduleDefID);
Module m = new Module();
m.SiteId = siteSettings.SiteId;
m.SiteGuid = siteSettings.SiteGuid;
m.ModuleDefId = moduleDefID;
m.FeatureGuid = moduleDefinition.FeatureGuid;
m.Icon = moduleDefinition.Icon;
m.CacheTime = moduleDefinition.DefaultCacheTime;
m.PageId = pageID;
m.ModuleTitle = moduleTitle.Text;
m.PaneName = ddPaneNames.SelectedValue;
//m.AuthorizedEditRoles = "Admins";
SiteUser currentUser = SiteUtils.GetCurrentSiteUser();
if (currentUser != null)
{
m.CreatedByUserId = currentUser.UserId;
}
m.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
m.HeadElement = WebConfigSettings.ModuleTitleTag;
m.Save();
CurrentPage.RefreshModules();
ArrayList modules = GetPaneModules(m.PaneName);
OrderModules(modules);
foreach (Module item in modules)
{
Module.UpdateModuleOrder(pageID, item.ModuleId, item.ModuleOrder, m.PaneName);
}
//WebUtils.SetupRedirect(this, Request.RawUrl);
//return;
CurrentPage.RefreshModules();
BindPanes();
upLayout.Update();
}
示例3: btnSave_Click
private void btnSave_Click(object sender, EventArgs e)
{
Page.Validate("webstore");
if ((Page.IsValid)&&(store != null))
{
SiteUser siteUser = SiteUtils.GetCurrentSiteUser();
if (store.SiteGuid == Guid.Empty)
{
store.SiteGuid = siteSettings.SiteGuid;
}
if (store.ModuleId == -1)
{
store.ModuleId = moduleId;
}
Module module = new Module(moduleId);
module.ModuleTitle = txtName.Text;
module.Save();
store.Name = txtName.Text;
store.Description = edDescription.Text;
store.OwnerName = txtOwnerName.Text;
store.OwnerEmail = txtOwnerEmail.Text;
store.SalesEmail = txtSalesEmail.Text;
store.SupportEmail = txtSupportEmail.Text;
store.EmailFrom = txtEmailFrom.Text;
store.OrderBccEmail = txtOrderBCCEmail.Text;
store.Phone = txtPhone.Text;
store.Fax = txtFax.Text;
store.Address = txtAddress.Text;
store.City = txtCity.Text;
if (!String.IsNullOrEmpty(ddZoneGuid.SelectedValue))
{
store.ZoneGuid = new Guid(ddZoneGuid.SelectedValue);
}
store.PostalCode = txtPostalCode.Text;
if (!String.IsNullOrEmpty(ddCountryGuid.SelectedValue))
{
store.CountryGuid = new Guid(ddCountryGuid.SelectedValue);
}
store.IsClosed = chkIsClosed.Checked;
store.ClosedMessage = edClosedMessage.Text;
if (store.Guid == Guid.Empty)
{
store.Created = DateTime.UtcNow;
store.CreatedBy = siteUser.UserGuid;
}
store.Save();
List<TaxClass> taxClasses = TaxClass.GetList(siteSettings.SiteGuid);
if (taxClasses.Count == 0)
{
TaxClass taxClass = new TaxClass();
taxClass.SiteGuid = siteSettings.SiteGuid;
taxClass.Title = WebStoreResources.TaxClassTaxable;
taxClass.Description = WebStoreResources.TaxClassTaxable;
taxClass.Save();
taxClass = new TaxClass();
taxClass.SiteGuid = siteSettings.SiteGuid;
taxClass.Title = WebStoreResources.TaxClassNotTaxable;
taxClass.Description = WebStoreResources.TaxClassNotTaxable;
taxClass.Save();
}
List<FullfillDownloadTerms> downloadTerms = FullfillDownloadTerms.GetList(store.Guid);
if (downloadTerms.Count == 0)
{
if(currentUser == null)currentUser = SiteUtils.GetCurrentSiteUser();
if (currentUser != null)
{
FullfillDownloadTerms term = new FullfillDownloadTerms();
term.Name = WebStoreResources.DownloadUnlimited;
term.Description = WebStoreResources.DownloadUnlimited;
term.CreatedBy = currentUser.UserGuid;
term.CreatedFromIP = SiteUtils.GetIP4Address();
term.StoreGuid = store.Guid;
term.Save();
}
}
WebUtils.SetupRedirect(this, Request.RawUrl);
}
}
示例4: btnCreateNewContent_Click
void btnCreateNewContent_Click(object sender, EventArgs e)
{
Page.Validate("contentwizard");
if (!Page.IsValid) { return; }
int moduleDefID = int.Parse(moduleType.SelectedItem.Value);
ModuleDefinition moduleDefinition = new ModuleDefinition(moduleDefID);
PageSettings CurrentPage = CacheHelper.GetCurrentPage();
Module m = new Module();
m.SiteId = siteSettings.SiteId;
m.SiteGuid = siteSettings.SiteGuid;
m.ModuleDefId = moduleDefID;
m.FeatureGuid = moduleDefinition.FeatureGuid;
m.Icon = moduleDefinition.Icon;
m.CacheTime = moduleDefinition.DefaultCacheTime;
m.PageId = CurrentPage.PageId;
m.ModuleTitle = moduleTitle.Text;
m.PaneName = "contentpane";
//m.AuthorizedEditRoles = "Admins";
SiteUser currentUser = SiteUtils.GetCurrentSiteUser();
if (currentUser != null)
{
m.CreatedByUserId = currentUser.UserId;
}
m.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
m.HeadElement = WebConfigSettings.ModuleTitleTag;
m.Save();
WebUtils.SetupRedirect(this, Request.RawUrl);
}
示例5: NewPage
//.........这里部分代码省略.........
page.SiteId = siteSettings.SiteId;
page.SiteGuid = siteSettings.SiteGuid;
page.IsPending = !publish;
page.PageName = mwaPage.title;
//page.PageTitle = mwaPage.title; // this was the override page title it should not be set here
if ((mwaPage.mt_keywords != null) && (mwaPage.mt_keywords.Length > 0))
{
page.PageMetaKeyWords = mwaPage.mt_keywords;
}
if (WebConfigSettings.AutoGeneratePageMetaDescriptionForMetaweblogNewPages)
{
page.PageMetaDescription = UIHelper.CreateExcerpt(mwaPage.description, WebConfigSettings.MetaweblogGeneratedMetaDescriptionMaxLength);
}
//if (WebConfigSettings.ShowUseUrlSettingInPageSettings)
//{
//}
string friendlyUrlString = SiteUtils.SuggestFriendlyUrl(page.PageName, siteSettings);
page.Url = "~/" + friendlyUrlString;
page.UseUrl = true;
switch (mwaPage.commentPolicy)
{
// open
case "1":
// if the post was previously closed to comments
// re-open it using the default allowed days
page.EnableComments = true;
break;
//closed
case "0":
case "2":
default:
page.EnableComments = false;
break;
}
// I'm not sure we should support the page created event handler here, people may do redirects there
// that would interupt our next steps
// maybe need a config setting to decide
// page.PageCreated += new PageCreatedEventHandler(PageCreated);
page.Save();
FriendlyUrl newFriendlyUrl = new FriendlyUrl();
newFriendlyUrl.SiteId = siteSettings.SiteId;
newFriendlyUrl.SiteGuid = siteSettings.SiteGuid;
newFriendlyUrl.PageGuid = page.PageGuid;
newFriendlyUrl.Url = friendlyUrlString;
newFriendlyUrl.RealUrl = "~/Default.aspx?pageid=" + page.PageId.ToInvariantString();
newFriendlyUrl.Save();
// create html module in center pane
ModuleDefinition moduleDefinition = new ModuleDefinition(HtmlContent.FeatureGuid);
Module m = new Module();
m.SiteId = siteSettings.SiteId;
m.SiteGuid = siteSettings.SiteGuid;
m.ModuleDefId = moduleDefinition.ModuleDefId;
m.FeatureGuid = moduleDefinition.FeatureGuid;
m.Icon = moduleDefinition.Icon;
m.CacheTime = moduleDefinition.DefaultCacheTime;
m.PageId = page.PageId;
m.ModuleTitle = page.PageTitle;
m.PaneName = "contentpane";
m.CreatedByUserId = siteUser.UserId;
m.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
m.HeadElement = WebConfigSettings.ModuleTitleTag;
m.ModuleOrder = 1;
m.Save();
HtmlRepository repository = new HtmlRepository();
HtmlContent html = new HtmlContent();
html.ModuleId = m.ModuleId;
html.ModuleGuid = m.ModuleGuid;
html.Body = mwaPage.description;
//html.CreatedBy = siteUser.UserId;
html.UserGuid = siteUser.UserGuid;
html.CreatedDate = DateTime.UtcNow;
html.LastModUserGuid = siteUser.UserGuid;
html.LastModUtc = DateTime.UtcNow;
html.ContentChanged += new ContentChangedEventHandler(html_ContentChanged);
repository.Save(html);
mojoPortal.SearchIndex.IndexHelper.RebuildPageIndexAsync(page);
SiteUtils.QueueIndexing();
CacheHelper.ResetSiteMapCache(siteSettings.SiteId);
return page.PageGuid.ToString();
}