本文整理汇总了C#中PageModel.Get方法的典型用法代码示例。如果您正苦于以下问题:C# PageModel.Get方法的具体用法?C# PageModel.Get怎么用?C# PageModel.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageModel
的用法示例。
在下文中一共展示了PageModel.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnFinish_Click
protected void btnFinish_Click(object sender, EventArgs e)
{
string title = (pageBuilderWizardPageTitle.Text).Trim();
long pageId = 0;
int languageId = 1033;
long folderId = -1;
long wireFrameId = 0;
// prep some variables for later use
PageModel pageModel = new PageModel();
PageData pageInfo = new PageData();
WireframeModel model = new WireframeModel();
WireframeData wireframeInfo = new WireframeData();
if (Request.QueryString["mode"] != "" && Request.QueryString["mode"] != null)
{
mode = Request.QueryString["mode"];
}
if (Request.QueryString["pageid"] != "" && Request.QueryString["pageid"] != null)
{
pageId = Convert.ToInt64(Request.QueryString["pageid"]);
}
if (Request.Form["ektronSelectedTemplate"] != "" && Request.Form["ektronSelectedTemplate"] != null)
{
wireFrameId = Convert.ToInt64(Request.Form["ektronSelectedTemplate"]);
}
string summary = Summary.Content;
if (Request.QueryString["folderid"] != "" && Request.QueryString["folderid"] != null)
{
folderId = Convert.ToInt64(Request.QueryString["folderid"]);
}
if (Request.QueryString["language"] != "" && Request.QueryString["language"] != null)
{
languageId = Convert.ToInt32(Request.QueryString["language"]);
}
if (languageId == -1)
{
languageId = contentAPI.RequestInformationRef.ContentLanguage;
}
System.Collections.Hashtable meta = metadata.Metadata;
List<long> selTaxonomy = selectTaxonomy.SelectedTaxonomies;
string metaXML = "";
string Quicklink = "";
//<metadata><meta id="3">Title</meta></metadata>
foreach (object key in meta.Keys)
{
metaXML += @"<meta id=""" + ((object[])meta[key])[0] + @""">" + EkFunctions.HtmlEncode(((object[])meta[key])[2].ToString()) + "</meta>";
}
metaXML = "<metadata>" + metaXML + "</metadata>";
// create or copy as needed
if (mode == "add")
{
// no pageId was passed, so we're in add mode
// create the wireframe
pageModel.CreateMasterLayout(title, folderId, "", languageId, wireFrameId, metaXML, summary, out pageInfo);
}
else
{
// we're in copy mode
// let's get the wireframeId based on the current template
pageModel.Get(pageId, out pageInfo, false);
wireframeInfo = model.FindByPageID(pageInfo.pageID);
wireFrameId = wireframeInfo.ID;
pageInfo.title = title;
// now we'll make the copy
pageModel.Copy(pageInfo, folderId, "", languageId, wireFrameId, metaXML, summary, out pageInfo);
}
if (selTaxonomy.Count > 0)
{
TaxonomyContentRequest tcr = new TaxonomyContentRequest();
tcr.ContentId = pageInfo.pageID;
tcr.TaxonomyList = String.Join(",", selTaxonomy.ConvertAll<string>(delegate(long l) { return l.ToString(); }).ToArray());
contentAPI.AddTaxonomyItem(tcr);
}
// we need to get the quicklink for the redirect just in case
wireframeInfo = model.FindByID(wireFrameId);
Quicklink = wireframeInfo.Path + "?Pageid=" + pageInfo.pageID;
if (Quicklink.IndexOf("LangType=") == -1)
{
if (Quicklink.IndexOf("?") > 0)
{
Quicklink += "&LangType=" + languageId.ToString();
}
else
{
Quicklink += "?LangType=" + languageId.ToString();
}
}
//.........这里部分代码省略.........