1) To enable the culture, activate pageworkFlow
2).cs file
using System;
using System.Web.UI.WebControls;
using Telerik.Workflow;
using System.Collections.Generic;
using Telerik.Workflow.WebControls;
using Telerik.Cms.Engine;
using System.Net.Mail;
using Telerik.Cms;
using Telerik.Security;
public partial class Sitefinity_Admin_ControlTemplates_Pages_PageViewer : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (this.workflow.Controls.Count > 0)
notificationArea.Visible = true;
workflow.Command += new CommandEventHandler(PageWorkflowMenu_Command);
}
void PageWorkflowMenu_Command(object sender, CommandEventArgs e)
{
WorkflowInstance workflow = ((WorkflowMenu)sender).GetWorkflow();
if (workflow != null)
{
List
this.LoadCommands(commands, workflow.Activity.Activities);
int idx = int.Parse((string)e.CommandArgument);
string strRole = string.Empty;
Telerik.Cms.CmsManager manager = new Telerik.Cms.CmsManager();
Telerik.Cms.ICmsPage page = manager.Provider.GetPageByWorkflow(workflow.ID);
System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage();
mailMsg.IsBodyHtml = true;
switch (idx)
{
case 0:
mailMsg.Subject = "page pending approval";
strRole = "administrators";
string relativeurl = page.DefaultUrl.Url;
mailMsg.Body += String.Format("The '{0}' page has been sent for approval. Comments:" + hiddenTextArea.Value + " To approve the page, please go to URL: http://{1}{2}?cmspagemode=edit", page.Name, System.Web.HttpContext.Current.Request.Url.Host, relativeurl.Substring(1));
break;
case 1:
mailMsg.Subject = "page approved";
strRole = "Content Editor";
mailMsg.Body += String.Format("The '{0}' page has been approved. Comments:" + hiddenTextArea.Value + " To approve the page, please go to URL: http://{1}/Sitefinity/Admin/Pages.aspx", page.Name, System.Web.HttpContext.Current.Request.Url.Host);
break;
case 2:
mailMsg.Subject = "page declined";
strRole = "Content Editor";
mailMsg.Body += String.Format("The '{0}' page has been declined. Comments:" + hiddenTextArea.Value + " ", page.Name, System.Web.HttpContext.Current.Request.Url.Host);
break;
}
if (!mailMsg.Subject.Equals(string.Empty))
{
string[] usernames = Telerik.Security.UserManager.Default.GetUsersInRole(strRole);
//For every user, send him or her an e-mail
foreach (string username in usernames)
{
System.Web.Security.MembershipUser user = Telerik.Security.UserManager.Default.GetUser(username);
mailMsg.To.Add(user.Email);
}
// Init SmtpClient and send
System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient();
if (mailMsg.To.Count <= 0)
mailMsg.To.Add(mailMsg.From);
smtpClient.Send(mailMsg);
}
}
}
private void LoadCommands(List
{
foreach (Activity act in activities)
{
if (act is EventActivity)
commands.Add((EventActivity)act);
this.LoadCommands(commands, act.Activities);
}
}
}
ஏஞ்சல்
என்னை பற்றி
Google reader
Categories
- .Net (9)
- .Net Crystal Report (1)
- .Net GridView (3)
- Articles (5)
- Log File .Net (1)
- Sharepoint (2)
- Sitefinity 3.7 (3)
- SQL (5)
- Technical Question and Ans (3)
- Validation (1)
- XML (2)
Wednesday, November 11, 2009
Culture Specifcation, Activate PageworkFlow
Posted by
Meera
at
10:34 PM
Labels: Sitefinity 3.7
When hearts listen
angel sing.If you seek an angel with an open heart...
You shall always find loved one