For all CMS lovers here is consolidated list fro all the management systems present till dated.
Click Here By Wiki
///save button functionlity
void btnChangePassword_Click(object sender, EventArgs e)
{
if (Validate(true))
{
try
{
string AppName = Membership.ApplicationName;
if (.Text.Trim().ToString() != .Text.Trim().ToString())
{.Text = " New and Confirm password Mismatch ! " ; }
else
{
if (Membership.Provider.ChangePassword(.Text, .Text, .Text))
{ //membership provider has Change Password checked in Web.Config
if (Membership.Provider.ChangePasswordQuestionAndAnswer(.Text, .Text, .Text, .Text))
{
//Message: " Your Password Has Been Sucessfully Changed.."
return;
}
}
catch (MembershipPasswordException ee)
{//Exception Message}
}
}
SPSecurity.RunWithElevatedPrivileges(
delegate()
{
try
{
WindowsImpersonationContext aspContext = null;
WindowsIdentity identity = WindowsIdentity.GetCurrent();
aspContext = identity.Impersonate();
ContextOptions o = ContextOptions.Negotiate;
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, this._DomainName, this._DomainName Path);
UserPrincipal UPrinci = new UserPrincipal(ctx);
UPrinci = UserPrincipal.FindByIdentity(ctx, SPContext.Current.Web.CurrentUser.LoginName);
UPrinci.ChangePassword(_oldpassword.Text, _newpassword.Text);
_labelmsg.Text = "Password changed successfully!" ;
} //Try
catch (PasswordException ex)
{ //ex.Message; Catch exception.}
} //Delegate
2. Add the needed colors
3. Create a calculated field name Calendar text Insert formula :
=Color&"|||"&Title
4. Add a CEWP(Content Editor WebPart)
<script language="JavaScript">
var SEPARATOR = "|||";
var nodes, category;
nodes = document.getElementsByTagName("a");
for(var i = 0; i < nodes.length; i++)
{
if(nodes[i].innerText.indexOf(SEPARATOR) != -1)
{
UpdateCalendarEntryText(nodes[i]);
var foundNode = nodes[i];
var trap = 0;
while(foundNode.nodeName.toLowerCase() != "td") {
foundNode = foundNode.parentNode;
trap++;
if(trap > 10)
{
break; // don't want to end up in a loop
}
}
var colour = GetCalendarColour(category);
if(colour ! "")
foundNode.style.background = colour;
}
}
function UpdateCalendarEntryText(anchorNode)
{
var children = anchorNode.childNodes;
for(var i = 0; i < children.length; i++)
{
if(children[i].nodeType == 3 && children[i].nodeValue.indexOf(SEPARATOR)
!= -1)
{
var parts = children[i].nodeValue.split(SEPARATOR);
category = parts[0];
children[i].nodeValue = parts[1];
}
else
UpdateCalendarEntryText(children[i]);
}
}
function GetCalendarColour(desc)
{
var colour;
switch(desc.toLowerCase())
{
case "red":
colour = "#ff0000";
break;
case "blue":
colour = "#0000ff";
break;
case "yellow":
colour = "#ffff00";
break;
case "green":
colour = "#008000";
break;
case "orange":
colour = "#ff8040";
break;
default:
colour = "";
}
nbsp;
return colour;
}
</script>
Bingo
--------
Code
//inialization
private LiteralControl Literal1;
SPSiteoCurrentSite = null;
SPWeb oweb =null;
int count;
DataTable dt =new DataTable();
string strStruct;
In CreateChildControls()
Literal1 = new LiteralControl();
Literal1.Load += new EventHandler(Literal1_Load);
Controls.Add(Literal1);
-------
on load event of Literal Control i'll be calling my Core functionlity which will be binded with this literal control.
MyFunction()
{
try {
count = 0;
//oCurrentSite = new
SPSite("http://syngdcds0138:1111");
oCurrentSite = SPContext.Current.Site;
oweb = oCurrentSite.OpenWeb();
oweb.AllowUnsafeUpdates = true;
SPList oProjectName = oweb.Lists["Tasks"];
SPQuery Query1;
DataTable Dtable;
DataView Dview;
SPListItemCollection items1;
SPUser currentUser = oweb.CurrentUser;
string UNAme = currentUser.Name;
Query1 = new SPQuery();
Dtable = new DataTable();
Dview = new DataView();
Query1.Query = "<Where><Eq><FieldRef Name='AssignedTo' /><Value Type='User'>" +
currentUser.Name + "</Value></Eq></Where>";
items1 = oProjectName.GetItems(Query1);
strStruct = "<div>" + "<table>";
foreach (SPListItem objItem in items1)
{//Pending Completed Overdue
string picture = string.Empty;
if (objItem["Status"].ToString() == "Overdue")
{ picture = @"~/_LAYOUTS/Images/ico-task-overdue.jpg";
}
else if (objItem["Status"].ToString() == "Completed")
{ picture = @"~/_LAYOUTS/Images/ico-task-Completed.jpg";
}
else
{picture = @"~/_LAYOUTS/Images/ico-task-Pending.jpg";
}
string[] CreatedBy = objItem["Created By"].ToString().Split('#');
string AssignedBY = CreatedBy[1];
string DDt = Convert.ToDateTime(objItem["DueDate"].ToString()).ToShortDateString();
strStruct += "<tr>" + "<td colspan=2 align='left'>" + "<img src='" + ResolveUrl(picture) + "'
/> " + "<a style='text-align:right; font-size:12px;' href='" + oweb.Url +
"/Lists/" + oProjectName.Title + "/DispForm.aspx?ID=" + objItem["ID"].ToString() + "&Source=" + oweb.Url + "'>" + objItem["Title"].ToString() + "</a>" + "</td></tr>" + "<tr><td colspan=2 style= 'font-family:Arial; font-size:xx-small;'>Due Date:" + DDt + " Assigned By:"
+ AssignedBY + " </td></tr>";
}
strStruct += "<tr><td></td><td> <a href='" + oweb.Url + "/Lists/" + oProjectName.Title + "/Allitems.aspx'>More>></a>" + "</td></tr>" + "<tr>" + "<td><img
src='~/_LAYOUTS/images/ico-task-Completed.jpg'> Completed " + "<img
src='~/_LAYOUTS/images/ico-task-Pending.jpg'> Pending " + "<img
src='~/_LAYOUTS/images/ico-task-overdue.jpg'> Overdue </td>"
+ "</tr>" + "</table></div>";
Literal1.Text = strStruct;
}
catch (Exception ee) { //Error}
}
Revert your comments for this article
Here I have selected a task list in which I have added a calculated field named “Indicator” and these indicators are calculated from the priority field which is categorized (high, Medium & Low).
Here is the code snippet for calculated field.
="<DIV><IMG
src='/_layouts/images/kpipeppers-"&(3-RIGHT(LEFT(Priority,2),1))&".gif'
/></DIV>"
Now added the following script in content editor webpart
<script type="text/javascript">
var theTDs = document.getElementsByTagName("TD");
var i=0; var TDContent = " ";
Special thanks: Christophe
There goes you can check timer execution in Timer job status & Timer job definitions in central administration which details the execution time and its status for success.
Just a Quick information of all the inbuilt Timer in sharepoint Sorted by Neil Click here
Here are the snipplets for Weekly, Monthly & Annual.
Hourly(Triggers @ Every Hour 01.Min)
SPHourlySchedule JobSchedule = new
SPHourlySchedule();
JobSchedule.BeginMinute = 1;
JobSchedule.EndMinute = 2;
Weekly (Triggers @ Thursday 04:01:00PM)
SPWeeklySchedule JobSchedule = new SPWeeklySchedule();
JobSchedule.BeginDayOfWeek = DayOfWeek.Thursday;
JobSchedule.EndDayOfWeek = DayOfWeek.Thursday;
JobSchedule.BeginHour = 16;
JobSchedule.EndHour = 16;
JobSchedule.BeginMinute = 01;
JobSchedule.EndMinute = 05;
JobSchedule.BeginSecond = 00;
JobSchedule.EndSecond = 00;
taskLoggerJob.Schedule = JobSchedule;
Special Thanks: Andrew Connell, Ganesh Bankar.
Authoring:
Visual Studio: >>Full development environment with a graphical designer that produces a template which can be associated with multiple sites, lists, and content types
Designer:>> Wizard-driven interface that utilizes conditions and actions to produce a template that contains a set of declarative rules and is bound to a specific list
Custom .NET code :
Visual Studio: >>Yes
Designer:>> No
Types:
Visual Studio: >>Sequential, State Machine
Designer:>> Sequential only
Completed Workflow:
Visual Studio: >>Workflow markup file and code-behind files are compiled into workflow assembly.
Designer:>> Workflow markup, workflow rules, and supporting files are stored uncompiled in a hidden document library on the site and compiled on demand.
Debugging:
Visual Studio: >>Yes. Visual Studio 2005 debugging except for JIT exceptions.
Designer:>> No step-by-step debugging available
Deployment:
Visual Studio: >>Packaged as a SharePoint feature and deployed to the server by an administrator
Designer:>> Deployed automatically when workflow is completed
Association:
Visual Studio: >>Template must be associated with each and every list before it will be available
Designer:>> Association occurs at design time only
Workflow Forms
Visual Studio: >> Can use any forms technology, such as InfoPath 2007 or ASP.NET 2.0 forms
Designer:>> Automatically generates ASP.NET 2.0 forms, which can then be customized
Create Custom Activities and Conditions
Visual Studio: >>Yes
Designer:>> No. Must use a predefined set of activities and conditions.
Workflow Modification
Visual Studio: >>Executing workflows can be modified.
Designer:>> No modification is possible.
-------