Hello Juraj,
Actaully i created one page Type(Live Streaming Page) and now i am going to create a page on the basis of that page Type (Live Streaming Page) which i created.
Now when i creating a new page than that newly created Page's ID i need to pass on some another function to process.
please see the below code which i wrriten using Global Event.
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CMS;
using CMS.DocumentEngine;
using CMS.DataEngine;
using System.Data;
using CMS.EventLog;
using GemPackAPI;
// Registers the custom module into the system
[assembly: RegisterModule(typeof(FCMNodeCreation))]
public class FCMNodeCreation : Module
{
public FCMNodeCreation() : base("CustomInit")
{
//
// TODO: Add constructor logic here
//
}
// Contains initialization code that is executed when the application starts
protected override void OnInit()
{
base.OnInit();
// Assigns custom handlers to events
DocumentEvents.Insert.After += Document_Insert_After;
DocumentEvents.InsertLink.Before += Document_InsertLink_Before;
}
private void Document_Insert_After(object sender, DocumentEventArgs e)
{
// Add custom actions here
try
{
//string whereCondition = "LiveStreamingVideoID=SCOPE_IDENTITY()";
DataSet liveStreamingvideos = DocumentHelper.GetDocuments("Test.LiveStreamingVideo")
.OnSite("Test")
.WhereGreaterThan("DocumentCreatedWhen", DateTime.Now.AddMinutes(-1))
//.Where(new WhereCondition(whereCondition))
.Result;
if (liveStreamingvideos.Tables[0] != null && liveStreamingvideos.Tables[0].Rows.Count > 0)
{
LiveStreamingController obj = new LiveStreamingController();
obj.createNodeOnFCM(liveStreamingvideos);
}
}
catch (Exception ex)
{
EventLogProvider.LogEvent(EventType.ERROR, "CreateNodeForOnFCMOfLiveStreamingVideo", "Execute(task)", ex.Message);
}
}
private void Document_InsertLink_Before(object sender, DocumentEventArgs e)
{
// Add custom actions here
}
}
so can you please tell me that how will i get that ID
Thanks