Wednesday, 30 April 2014

SharePoint infinite scroll display template

SharePoint infinite scroll display template
Open Control Template
When you add post render, you can hide _#= ctx.RenderGroups(ctx) =#_
Now how to add post render
AddPostRenderCallback(ctx, function()
{
});
Or
$addRenderContextCallback(ctx, "OnPostRender", function () {
myCustomjsfunction(ctx);
});
function myCustomjsfunction(ctx){
/* Try to get the visible div and create if if nesessary. */
var visibleOutPut=document.getElementById('cbs.VisibleOutput');
if($isNull(visibleOutPut)){
//Create the visible div.
visibleOutPut=document.createElement("ul");
visibleOutPut.setAttribute("id", "cbs-VisibleOutPut");
visibleOutPut.className="cbs-List";
$('#Hidden').patent().parent().prepend(visibleOutput);
}
/* Copy all of the LIs in hiddenOutPut tp visibleOutPut. */
var hiddenOutPut=$('#Hidden');
var items=hiddenOutPut.children('li');
items.each(function(i){
visibleOutPut.appendChild(items[i].cloneNode(true));
});
/* Register for the scrolling event */
$('#s4-workspace').scoll(function() {
//Check if we're at the bottom of the page.
var scrollPostion=$('#s4-workspace').scrollTop() + $('#s4-workspace').height();
if(scrollPosition >= $('#s4-bodyContainer')height()){
/* This is where the magic happens */
//get paginginfo from the search context.
var paginfInfo= ctx.ClientControl.get_pagingInfo();
var lastPage=pagingInfo[pagingInfo.length - 1];
//if lastPage = -2, there are more search results..
var hasNextpage=lastPage.pageNumber==-2;
if(hasNextPage){
//if there are more items..
ctx.ClientControl.page(lastPage.startItem);
}
};
Go through below video from 45min onwards..
http://channel9.msdn.com/Events/SharePoint-Conference/2012/SPC246

Content Search webpart Images are missing

Content Search webpart Images are missing
Reason would be many..
1.User should have ready only permissions in List.
2.Image should be checked in (All data should be published..)
3.in Source list..list settings-->Version Settings-->Draft Item security: Only users who can approve items (and the author of the item)
should be selected.

Now try in CSWB.

SharePoint OnPostRender

SharePoint OnPostRender
When you add post render, you can hide _#= ctx.RenderGroups(ctx) =#_
Now how to add post render
AddPostRenderCallback(ctx, function()
{
});
Or
$addRenderContextCallback(ctx, “OnPostRender”, function () {
myCustomjsfunction(ctx);
});

SQL Server forgot password

SQL Server forgot password

I forgot my sql server password, now i want to reset.
We can reset without having old password
Open Command prompt
Use below commands..
osql-E -S .\SQLEXPRESS(Your SQL Server Name)
exec sp_password @new='Enternewpassword', @loginame='sa'
go
alter login sa enable
go
exit
Now using sa account with new password you can login to sql server

Sharepoint Upload Document to Document Library

public bool UploadToMoss(HttpPostedFile filename, string strDocLibraryName, string strDocCategory, string strDocType)
{
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsImpersonationContext ctx = null;
RevertToSelf();
bool blStatus = true;
try
{
ctx = WindowsIdentity.GetCurrent().Impersonate();
SPSite siteCollection = null;
SPWeb topLevelSite = null;
string strDocLibraryLink = System.Configuration.ConfigurationManager.AppSettings["SPDocLibrary"].ToString();
siteCollection = new SPSite(strDocLibraryLink);
topLevelSite = siteCollection.AllWebs[ConfigurationManager.AppSettings["TopLevelSite"].ToString()];
topLevelSite.AllowUnsafeUpdates = true;
SPFolder objFolder = topLevelSite.GetFolder("" + strDocLibraryName + "/" + strDocCategory + "/" + strDocType + "");
byte[] bufDoc = null;
string strFileName = Path.GetFileName(filename.FileName);
int nLen = filename.ContentLength;
bufDoc = new byte[nLen];
Stream oStream = filename.InputStream;
oStream.Read(bufDoc, 0, nLen);
System.GC.AddMemoryPressure(200024);
SPFile file = objFolder.Files.Add(strFileName, oStream, true);
file.Update();
}
catch (Exception ex)
{
blStatus = false;
throw;
}
finally
{
System.GC.RemoveMemoryPressure(200024);
ctx.Undo();
}
return blStatus;
}

Sharepoint 2013 Training Concepts

Sharepoint 2013 Training Concepts
v  Introduction to SharePoint Server 2013
·         Overview
·         Business Goals
·         Pillars of SharePoint Server
·         SharePoint Server Architecture
·         Installing and Preparing SharePoint Server – Virtual Environment
 
v  SharePoint Server – Areas and Features that have been improved
 
v  Understanding SharePoint 2013 Fundamental Components
·         Web Applications
·         Web Application Extensions
·         SharePoint Server – Central Administration and PowerShell
·         SharePoint Site Collections and Sites
·         Libraries and Lists
·         Columns and Content Types
 
v  Understanding New Features of SharePoint 2013
·         Developer Specific Enhancements
·         Authentication
·         Business Connectivity Services
·         Mobile Devices in SP 2013 Preview
·         Workflow Features
·         Web Content Management
·         Social Computing
·         Records Management Features
·         SharePoint Business Intelligence
·         Enterprise Search
 
v  Introduction to Office 2013 and SharePoint 2013 development
·         New features for Office 2013 and SharePoint 2013
·         App scenarios for Office 2013 and SharePoint 2013
·         Development options for Office 2013 and SharePoint 2013
 
v  SharePoint 2013 app model for developers
·         Why apps for SharePoint 2013?
·         Introducing the app model for SharePoint 2013, Part 1
·         Introducing the app model for SharePoint 2013, Part 2
 
v  SharePoint 2013 developer tools
·         Development model for apps for SharePoint 2013
·         Design patterns for apps for SharePoint 2013
·         Create SharePoint 2013 app projects
·         Package and deploy apps for SharePoint 2013
 
v  Create hosted apps in SharePoint 2013
·         SharePoint-hosted app model for SharePoint 2013
·         SharePoint-hosted app model for SharePoint 2013 (Demo)
·         Using JavaScript and jQuery for SharePoint 2013
·         Using JavaScript and jQuery for SharePoint 2013 (Demo)
·         SharePoint 2013 chrome control
·         SharePoint 2013 cross-domain calls
 
v  Create cloud-hosted apps for SharePoint 2013
·         SharePoint 2013 app hosting models
·         Developer-hosted apps for SharePoint 2013
·         Windows Azure auto-provisioned apps for SharePoint 2013
 
v  SharePoint 2013 client object model (CSOM) and REST APIs
·         SharePoint 2013 strategy for SharePoint client object model (CSOM) and REST
·         Programming SharePoint client object model (CSOM) with C# and JavaScript
·         SharePoint 2013 REST and OData fundamentals
·         Making REST calls with C# and JavaScript for SharePoint 2013
·         Making REST calls with C# and JavaScript for SharePoint 2013 (Demo)
 
v  SharePoint Pages
Introduction to SP Pages
Customizing and Developing SP Pages
                                          i.    Creating Master Pages
                                         ii.    Creating Site Pages
                                        iii.    Creating Application Pages
 
v  Packaging and Deployment
SharePoint Features
                                        iv.    Elements
SharePoint Solution Packaging
                                         v.    Deploying SP Solutions
SP Project Structure in VS
                                        vi.    Feature Designer
                                       vii.    Mapped Folders
                                      viii.    Activation Dependencies
                                        ix.    Feature Designer for Advanced Users
                                         x.    Package Designer
                                        xi.    Package Explorer
Configurable Deployment
                                       xii.    Custom Deployment Steps
                                      xiii.    Deployment Conflicts
                                      xiv.    Sandboxed and Farm Solutions
                                       xv.    Auto-retract
v  OAuth and application identity in SharePoint 2013
·         SharePoint 2013 application identity and permissions
·         Requesting and granting application permissions in SharePoint 2013
·         SharePoint 2013 OAuth implementation
·         Authentication using server-to-server high trust in SharePoint 2013
 
v  Develop SharePoint 2013 remote event receivers
·         Introducing remote event receivers in SharePoint 2013
·         Remote event receivers in SharePoint 2013 (Demo)
 
v  Workflow changes and features in SharePoint 2013
·         SharePoint 2013 workflow architecture platform overview
·         Developing SharePoint 2013 workflows with SharePoint Designer
·         Developing SharePoint 2013 workflows with SharePoint Designer (Demo)
·         Developing SharePoint 2013 workflows with Visual Studio
·         Developing SharePoint 2013 workflows with Visual Studio (Demo)
 
v  Business connectivity services changes in SharePoint 2013
·         SharePoint 2013 Business Connectivity Services and OData services overflow
·         App-level external content types for SharePoint 2013
·         SharePoint 2013 custom event receivers
·         SharePoint 2013 custom event receivers (Demo)
 
v  Search features and changes in SharePoint 2013
·         SharePoint 2013 Search overview
·         Executing queries in SharePoint 2013
·         Executing queries in SharePoint 2013 (Demo)
·         Search verticals in SharePoint 2013
·         Search verticals in SharePoint 2013 (Demo)
·         Search content parsing and web callouts in SharePoint 2013
 
v  Enterprise content management changes in SharePoint 2013
·         EDiscovery for SharePoint 2013
·         Managed metadata service and taxonomy improvements in SharePoint 2013
 
v  Web content management changes and features in SharePoint 2013
·         SharePoint 2013 web content management platform improvements
·         SharePoint 2013 web content management platform improvements (Demo)
·         SharePoint 2013 web content management content authoring
·         SharePoint 2013 web content management content by search web part
·         SharePoint 2013 custom branding sites
·         SharePoint 2013 custom branding sites (Demo)
·         Usage analytics and multilingual enhancements in SharePoint 2013
 
v  Social features in SharePoint 2013
·         SharePoint 2013 social overview and My Site
·         SharePoint 2013 social overview and My Site (Demo)
·         SharePoint 2013 micro feed overview
·         SharePoint 2013 communities’ overview
 
v  Office services in SharePoint 2013
·         Excel Services for SharePoint 2013
·         Word Automation Services for SharePoint 2013
·         PowerPoint Automation Services for SharePoint 2013
·         SharePoint 2013 Translation Services
 
v  Create mobile apps for SharePoint 2013
·         SharePoint 2013 mobile development basics
·         Creating mobile apps with SharePoint 2013 (Demo)
·         Understand and develop push notifications in SharePoint 2013
·         Understand and develop location-aware apps in SharePoint 2013
 
v  Develop apps for Office 2013
·         Intro to Apps and Web Extensibility Framework (WEF) for Office 2013
·         Apps for Office 2013 Visual Studio 11 tools
·         Develop task pane apps for Office 2103 with Visual Studio 11 (Demo)
·         Develop content apps for Office 2013 with Visual Studio 11 (Demo)
·         Develop mail apps for Office 2103 with Visual Studio 11 (Demo)
·         Package and deploy Office 2013
·         Design and theme apps for Office 2013
 

v  Conclusion

Tuesday, 29 April 2014

How to restart Sharepoint ULS logs

Sharepoint restart ULS logs
if you want to get new log file. just restart SharePoint 2010 Tracing server.
GO to services.msc and find SharePoint 2010 Tracing server
Restart.

On which Account RunWithElevatedPrivileges will run

On which Account RunWithElevatedPrivileges will run


RunWithElevatedPrivileges creates a new thread with the App Pool’s credentials, blocking your current thread until it finishes

C# Generics Demo

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
//using System.Web;
//using System.Web.Security;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using System.Web.UI.WebControls.WebParts;
//using System.Web.UI.HtmlControls;
public partial class GenericsDemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Student dhas = new Student("Manick", "Dhas", 22);
Student raj = new Student("Sundar", "Raj", 32);
///Using a custom strongly typed StudentList
StudentList mc = new StudentList();
mc.Add(dhas);
mc.Add(raj);
Response.Write("Using a custom strongly typed StudentList
");
foreach (Student s in mc)
{
Response.Write("First Name : " + s.FirstName + "
");
Response.Write("Last Name : " + s.LastName + "
");
Response.Write("Age : " + s.Age + "

");
}
///Creating a list of Student objects using my custom generics
MyCustomList student = new MyCustomList();
student.Add(dhas);
student.Add(raj);
Response.Write("
Using a list of Student objects using my custom generics
");
foreach (Student s in student)
{
Response.Write("First Name : " + s.FirstName + "
");
Response.Write("Last Name : " + s.LastName + "
");
Response.Write("Age : " + s.Age + "

");
}
///Creating a list of Student objects using my custom generics
MyCustomList intlist = new MyCustomList();
intlist.Add(1);
intlist.Add(2);
Response.Write("
Using a list of String values using my custom generics
");
foreach (int i in intlist)
{
Response.Write("Index : " + i.ToString() + "
");
}
///Creating a list of Student objects using my custom generics
MyCustomList strlist = new MyCustomList();
strlist.Add("One");
strlist.Add("Two");
Response.Write("
Using a list of int values using my custom generics
");
foreach (string str in strlist)
{
Response.Write("Index : " + str + "
");
}
}
}
///
/// Student Class
///
public class Student
{
private string fname;
private string lname;
private int age;
///
/// First Name Of The Student
///
public string FirstName
{
get { return fname; }
set { fname = value; }
}
///
/// Last Name Of The Student
///
public string LastName
{
get { return lname; }
set { lname = value; }
}
///
/// Age of The Student
///
public int Age
{
get { return age; }
set { age = value; }
}
///
/// Creates new Instance Of Student
///
/// FirstName
/// LastName
/// Age
public Student(string fname, string lname, int age)
{
FirstName = fname;
LastName = lname;
Age = age;
}
}
///
/// Strongly Typed Class
/// Accepts only Student Type
///
public class StudentList : IEnumerable
{
private ArrayList alist = new ArrayList();
///
/// Adds new value of type Student
///
/// Object of Student Class
/// Returns the index of the Object
public int Add(Student value)
{
try
{
return alist.Add(value);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Removes The Object from StudentList
///
/// Object of Student Class
public void Remove(Student value)
{
try
{
alist.Remove(value);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Removes the student object
///
/// Index of the Student object to be removed
public void RemoveAt(int index)
{
try
{
alist.RemoveAt(index);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Gets the count of the StudentList
///
public int Count
{
get { return alist.Count; }
}
#region IEnumerable Members
///
/// Returns an enumerator that iterates through a StudentList.
///
/// An System.Collections.IEnumerator object that can be used to iterate through the StudentList
public IEnumerator GetEnumerator()
{
try
{
return alist.GetEnumerator();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
///
/// Custom Generic Accepts any Types
///
///
public class MyCustomList : IEnumerable, IEnumerable
{
private ArrayList alist = new ArrayList();
///
/// Adds new value of type T
///
/// Object of Type T
/// Returns the index
public int Add(T value)
{
try
{
return alist.Add(value);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Removes The Object from MyCustomList
///
/// Object of Type T
public void Remove(T value)
{
try
{
alist.Remove(value);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Removes the object at index
///
/// Index of the T object to be removed
public void RemoveAt(int index)
{
try
{
alist.RemoveAt(index);
}
catch (Exception ex)
{
throw ex;
}
}
///
/// Gets the count of the MyCustomList Object
///
public int Count
{
get { return alist.Count; }
}
#region IEnumerable Members
///
/// Returns an enumerator that iterates through a collection.
///
/// An System.Collections.IEnumerator object that can be used to iterate through the collection
public IEnumerator GetEnumerator()
{
try
{
return alist.GetEnumerator();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region IEnumerable Members
///
/// Returns an enumerator that iterates through a collection.
///
/// An System.Collections.IEnumerator object that can be used to iterate through the collection
IEnumerator IEnumerable.GetEnumerator()
{
try
{
return (IEnumerator)alist.GetEnumerator();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}

Thread in C#

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
namespace OnlyOneInstance
{
static class Program
{
[STAThread]
static void Main()
{
bool instantiated;
/* If instantiated is true, this is the first instance of the application; else, another instance is running. */
Mutex mutex = new Mutex(true, "UniqueID", out instantiated);
if (!instantiated)
{
MessageBox.Show("Already Running");
return;
}
Application.Run(new Form1());
GC.KeepAlive(mutex);
}
}
}

How to Change the sharepoint service Account

How to Change the sharepoint service Account
Change the sharepoint service Account
1.Go to Sharepoint Server
2.Start->run-->services.msc
3.Single click on Service which you want to change Log on Account(Service Account).
4.Right click-->properties-->Log on Tab-->Change the existing account.

Monday, 28 April 2014

How can i open services of other server in windows?

How can i open services of other server in windows?
Log into any server services.msc
In the left side right Click on Service
Click on Connect to another computer
Select another computer
Enter name of another computer
Click browse.
You will able to view another server services.msc

SharePoint Document ID Service Feature not found

SharePoint Document ID Service Feature not found
Open SharePoint 2010 Manager tool, expand _SharePoint_Config node and expand Feature Definitions
Look for Document ID service feature (DocId), right lick on it and select install
After install, this should show the Document ID Service feature under the site collection features

General Software Knowledge Transfer plan Check Points

General Software Knowledge Transfer plan Check Points
In any industry, knowledge transfer is very important.

Based on my experience i used to plan below points while tacking KT and giving KT to others.

Some times it will be vary depends on the type of project which we are handling. But most of the times, i will follow below point to cover..
• Requirement documents(User stories),Functional Document and Technical Documents
• Application Demo
• Application Architecture
• Current Team Members & Stakeholders
• Business Overview
• Process(Development) (Offshore and onsite)
• Portal Details(Like SharePoint Site..)
• Database
• 3rd party tools
• Environments(Dev, Test, UAT and Prod)
• Service Accounts
• VSTS Information
• Build Process
• Deployment Process(Apps team Details)
• Troubleshooting Guide
• Support team
• Integration Points
• Technology Challeges
• Learning Curves
• Pain Points as defined by the Customer
• Area of Improvements

UTC to Local

//get UTC Time
string strDate = DateTime.UtcNow.ToString("yyyy-MM-ddThh:mm:ssZ");
//Convert to Local Time
DateTime localDateTime = DateTime.Parse(strDate);
DateTime utcDateTime = localDateTime.ToUniversalTime();

Regular expression to avoid special characters

private bool IsValidName(string strtxt)
{
bool returnValue = false;
Regex regx = new Regex(@"^[\w\s -]*$");
returnValue = regx.IsMatch(strtxt);
return returnValue;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (!IsValidName(txtA.Text))
{
Response.Write("Entered Special Charectors-Not correct name");
}
else
{
Response.Write(txtA.Text);
}
}

C# Dictionary

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
namespace Test_N.G
{
public partial class A : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Author A1 = new Author(TextBox1.Text, TextBox2.Text, "AAA", "123-4567");
Author A2 = new Author("TTT", "B", "BBB", "123-7823");
Author A3 = new Author("MS", "C", "CCC", "123-6383");
Dictionary dict = new Dictionary();
dict.Add(A1.Id, A1);
dict.Add(A2.Id, A2);
dict.Add(A3.Id, A3);
lboxDictionary.DataSource = dict;
lboxDictionary.DataBind();
ReadDic(dict);
}
protected void ReadDic(Dictionary dict)
{
//Read Dictionary
string strToEmail = string.Empty;
HashSet setUniqEmail = new HashSet();
foreach (KeyValuePair kv in dict)
{
Author au = kv.Value;
strToEmail += au.AuthorName + ",";
}
string[] sArray = strToEmail.Split(',');
HashSet set = new HashSet(sArray);
string[] result = new string[set.Count];
set.CopyTo(result);
//setUniqEmail = set;
foreach (string i in set)
{
string strBody = string.Empty;
foreach (KeyValuePair kv in dict)
{
Author au = kv.Value;
if ((i != null) & (i != ""))
{
if (i == au.AuthorName)
{
strBody += au.Id + "-" + au.ItemURL + "-" + au.AuthorName + "-" + au.searchKeyWord + System.Environment.NewLine;
}
}
}
Response.Write(strBody);
}
}
}
public abstract class AAbstractEntity
{
private string _id;
public AAbstractEntity(string id)
{
_id = id;
}
public string Id
{
get { return _id; }
set { _id = value; }
}
public abstract bool IsValid
{
get;
}
}
public class Author : AAbstractEntity
{
private string _ItemURL;
private string _AuthorName;
private string _searchKeyWord;
public Author(string id, string ItemURL, string AuthorName, string searchKeyWord)
: base(id)
{
_ItemURL = ItemURL;
_AuthorName = AuthorName;
_searchKeyWord = searchKeyWord;
}
public string ItemURL
{
get { return _ItemURL; }
set { _ItemURL = value; }
}
public string AuthorName
{
get { return _AuthorName; }
set { _AuthorName = value; }
}
public string searchKeyWord
{
get { return _searchKeyWord; }
set { _searchKeyWord = value; }
}
public override bool IsValid
{
get
{
if (Id.Length > 0 && AuthorName.Length > 0)
return true;
else
return false;
}
}
public override string ToString()
{
return Id + "," + AuthorName + ", " + ItemURL + "," + searchKeyWord;
}
}
}

C# Collection Custom Order Display

C# Collection Custom Order Display
Collection filter = new Collection();
//filter=Coming from External Source with different order Date is: S,O,M,C,I,R
//Now i have to change the order of filter based on some custom condition.
//I am going to take new collection with name:afterfilColl
Collection afterfilColl = new Collection();
if (filter.Items.Count != 0)
{
int countno = 8;
if (filter.Items.Count > 8)
{
countno = filter.Items.Count;
}
for (int i = 0; i < countno; i++)
{
afterfilColl.Insert(i, null);
}
}
int j = 0;
for (int i = 0; i < filter.Items.Count; i++)
{
if (filter.Items[i].Name == "M")
{
afterfilColl.RemoveAt(0);
afterfilColl.Insert(0, filter.Items[i]);
}
else if (filter.Items[i].Name == "I")
{
afterfilColl.RemoveAt(1);
afterfilColl.Insert(1, filter.Items[i]);
}
else if (filter.Items[i].Name == "C")
{
afterfilColl.RemoveAt(2);
afterfilColl.Insert(2, filter.Items[i]);
}
else if (filter.Items[i].Name == "R")
{
afterfilColl.RemoveAt(3);
afterfilColl.Insert(3, filter.Items[i]);
}
else if (filter.Items[i].Name == "O")
{
afterfilColl.RemoveAt(5);
afterfilColl.Insert(5, filter.Items[i]);
}
else if (filter.Items[i].Name == "S")
{
afterfilColl.RemoveAt(7);
afterfilColl.Insert(7, filter.Items[i]);
}
else
{
afterfilColl.Insert(j + 8, filter.Items[i]);
j++;
}
}
filter.Items.Clear();
for (int i = 0; i < afterfilColl.Count; i++)
{
if (afterfilColl[i] != null)
{
filter.Items.Add(afterfilColl[i]);
}
}
//Now i will get date in to filter collection with order of M,I,C,R,O,S

Sunday, 27 April 2014

SPQuery Filter

SPSite oSite = SPContext.Current.Site;
SPWeb oWeb = oSite.OpenWeb();
SPList oList = oWeb.Lists["ListName"];
SPQuery oQuery = new SPQuery();
oQuery.Query = ""
+ "";
SPListItemCollection oItems = oList.GetItems(oQuery);
To filter on date use the following to get any item that has been modified in the last 7 days:
string dateString = Microsoft.SharePoint.Utilities.
SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Today.AddDays(-7));
oQuery.Query = "+ dateString+"

Sharepoint FAQ

Sharepoint FAQ
Where do you deploy the additional files used in your webpart, like css or javascript files, and how do you use them in your WebPart?
Ans. You can deploy the css or javascript files in _layouts folder in SharePoint's 12 hive. To use them in your webpart, you need to first register them to your webpart page and then specify a virtual path for the file for e.g. _layouts\MyCSS.css See Code examples at Using External Javascript, CSS or Image File in a WebPart.
What are the best practices for SharePoint development.
Ans. Some of the best practices are:
1. You should always dispose SPsite and SPWeb objects, once you refer them in your code. Using the "Using" clause is recommended.
2. Use RunwithelevatePrivilages to avoid errors for end users.
3. Try writing your errors to SharePoint error logs (ULS Logs). Since it’s a bad idea to fill-up event log for your production environment.
4. Use SPQuery instead of foreach loop while retrieving Items from the list.
5. Deploy additional files used in your webpart to 12 hive. Use your solution package to drop the files in 12 hive. Also, make sure that all the references (for e.g. Css or .js files) get removed when the solution is retracted.
How do make an existing non-publishing site Publishing?
Ans. You can simply activate the SharePoint Publishing Feature for the Site, you want to make publishing..
How do you deploy a User Control in SharePoint ?
Ans. You deploy your User Control either by a Custom webpart, which will simply load the control on the page or can use tools like SmartPart, which is again a webpart to load user control on the page. User Control can be deployed using a custom solution package for the webapplication or you can also the control in the webpart solution package so that it gets deployed in _controlstemplate folder.
Which is faster a WebPart or a User Control?
Ans. A WebPart renders faster than a User Control. A User Control in SharePoint is usually loaded by a webpart which adds an overhead. User Controls however, gives you an Interface to add controls and styles.
What SharePoint Databases are Created during the standard Install?
Ans. During standard install, the following databases are created :
SharePoint_AdminContent
SharePoint_Config
WWS_Search_SERVERNAME%_%GUID_3%
SharedServicesContent_%GUID_4%
SharedServices1_DB_%GUID_5%
SharedServices1_Search_DB_%
GUID_6%WSS_Content_%GUID_7%
While creating a Web part, which is the ideal location to Initialize my new controls?
Override the CreateChildControls method to include your new controls. You can control the exact rendering of your controls by calling the .Render method in the web parts Render method.
How do you return SharePoint List items using SharePoint web services?
Ans.
In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.
What are Customized and Uncustomized Files in SharePoint ?
Ans. There are two types of Pages in SharePoint; site pages (also known as content pages) and application pages.
Uncustomized :
When you create a new SharePoint site in a site collection, Windows SharePoint Services provisions instances of files into the content database that resides on the file system. That means if you create a new Site "xyz" of type Team Site(or Team sIte Definition), an instance of the Team Site Definition( Which resides on the File System), i.e. "xyz" gets created in the Content database. So, When ASP.NET receives a request for the file, it first finds the file in the content database. This entry in the content database tells ASP.NET that the file is actually based on a file on the file system and therefore, ASP.NET retrieves the source of the file on the file system when it constructs the page.
Customized :
A customized file is one in which the source of the file lives exclusively in the site collection's content database. This happens When you modify the file in any way through the SharePoint API, or by SharePoint Designer 2007,which uses the SharePoint API via RPC and Web service calls to change files in sites. So, When the file is requested, ASP.NET first finds the file in the content database. The entry in the database tells ASP.NET whether the file is customized or uncustomized. If it is customized, it contains the source of the file, which is used by ASP.NET in the page contraction phase.
If I wanted to restrict the deletion of the documents from a document library, how would I go about it?
Ans. You would create a event receiver for that list/library and implement the ItemDeleting method. Simply, set: properties.Cancel= true and display a friendly message using Properties.Message("How can u delete this... Its not your stuff!");
How would you remove a webapart from the WebPart gallery? Does it get removed with Webpart retraction?
Ans. No, Webpart does not get removed from the WebPart gallery on retraction. You can write a feature receiver on Featuredeactivating method to remove the empty webpart from the gallery.
How Do you bind a Drop-Down Listbox with a Column in SharePoint List ?
Ans.
Method 1 : You can get a datatable for all items in the list and add that table to a data set. Finally, specify the dataset table as datasource for dropdown listbox.
Method 2 : You can also use SPDatasource in your aspx or design page.
Page Layout in Sharepoint
http://weblogs.asp.net/jimjackson/archive/2007/11/05/create-a-new-page-layout-in-sharepoint-2007-feature-based.aspx
http://mysharepointwork.blogspot.com/2010/05/sharepoint-2007-moss-2007-interview.html.

Microsoft.SharePoint.Client.Runtime.dll Microsoft.SharePoint.Client.dll path

Microsoft.SharePoint.Client.Runtime.dll Microsoft.SharePoint.Client.dll path

Client Object Model DLL and path
%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI
Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll.

Unable to connect to printer on port 5252. No connection could be made because the target machine actively refused it.

Unable to connect to printer on port 5252. No connection could be made because the target machine actively refused it.

Solution: K2 blackpoint Server might be stopped

Saturday, 26 April 2014

Value labs asp.net interview

in dataset how to get updated records only (Ds having 1lak records, out of 1 lak only 3 records have updated how can in find that 3 records
how to move one table to another table in ds
how to pass optional arguments to a function
can i call view state in page init event
how to get inserted record value form sql
how is the use of 3 tier architecture
if we developed a application using class files are there any disadvantages

TCS Interview Question

[0]ArrayList ->integer
[Ram]HashTable ->string
->inter face
->overload
override
intrpath to list(pass data)
data view web part
merge 2 list data
read write XMl , read child node from xml
hash table
array list
dictonrey
what is the name space to read repeative table data from infopath
repeatervaly
read infopath
how to delete a document from doc library after 1 month form uploaded date
java script in web part
if user having read only permissions , by using elevated if you create a new item in the custom list using object model code what will be the "created by" column data in the sharepoint
Onclint in button
publish infopath
extend web application
in BDC how to do pagination
what is refactor
can we work offline with infopath
what are the drawbacks of BDC
can we update other sql tables using BDC
why w have to use infopath insted of .net aspx

K2 Email Notification is not working

Not sending email in K2
Q)Email event with sharepoint group in the To field not sending email to the correct user after the sharepoint group member are changed.
Resolution: Issue mentioned on the ticket is a known issue (reproduced) and scheduled to be fixed on kb1290 (if things are going as scheduled).
As a workaround (suggested by our lab team), please go to HostServer db and truncate the following table:
Groups
GroupUsers
User2
These tables will repopulate once a new process instance is created.

SHarePoint List item Update using ArrayList

UpdateSharepoint List using ArrayList
public void (ArrayList objArrayList, string ListItemID)
{
//WindowsIdentity objWindowsIdentity = WindowsIdentity.GetCurrent();
//RevertToSelf();
SPSite siteCollection = null;
SPWeb topLevelSite = null;
SPList list = null;
SPListItem objListItem = null;
try
{
if (objArrayList != null && objArrayList.Count > 0)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
siteCollection = new SPSite(System.Configuration.ConfigurationManager.AppSettings["SPDocumentLibrary"].ToString());
topLevelSite = siteCollection.AllWebs[ConfigurationManager.AppSettings["TopLevelSite"].ToString()];
});
topLevelSite.AllowUnsafeUpdates = true;
list = topLevelSite.Lists[System.Configuration.ConfigurationManager.AppSettings["ListName"]];
siteCollection.OpenWeb();
siteCollection.AllowUnsafeUpdates = true;
topLevelSite.AllowUnsafeUpdates = true;
objListItem = list.GetItemById(Convert.ToInt32(ListItemID.Trim()));
string[] myStringArray = (string[])objArrayList.ToArray(typeof(string));
for (int i = 0; i < myStringArray.Length; i++)
{
string[] strNameValue = myStringArray[i].Split(';');
objListItem[strNameValue[0]] = strNameValue[1];
}
objListItem.Update();
}
}
catch (Exception ex)
{
throw new Exception(ex.StackTrace);
}
finally
{
topLevelSite.AllowUnsafeUpdates = false;
siteCollection.AllowUnsafeUpdates = false;
siteCollection.Dispose();
topLevelSite.Dispose();
objListItem = null;
list = null;
topLevelSite = null;
siteCollection = null;
}
}

Javascript sessionStorage

Javascript sessionStorage
Assign session Storage in one page
objColl={};
objColl["A"].width= "20";
objColl["A"].height= "20";
sessionStorage.setItem('ProjInfo', JSON.stringify(objColl));
Use SessionStorage in another page
var arrSession = JSON.parse(sessionStorage.getItem('ProjInfo'));
var PAWidth = arrSession["A].width;
var PAHeight = arrSession["A].height;

Get Latest Version on Check Out in TFS

Get Latest Version on Check Out in TFS

Sharepoint 2010 requirements

Hardware requirements
-------------------------
Component Minimum requirement
Processor 64-bit, four cores
RAM 4 GB for developer or evaluation use
8 GB for production use in a single server or multiple server farm
Hard disk
80 GB for system drive
Software requirements
----------------------
Database server in a farm:The 64-bit edition of Microsoft SQL Server 2008 R2.
Single server with built-in database:The 64-bit edition of Windows Server 2008 Standard, Enterprise, Data Center, or Web
Server with SP2, or the 64-bit edition of Windows Server 2008 R2 Standard, Enterprise, Data Center, or Web Server. If you
are running Windows Server 2008 without SP2, the Microsoft SharePoint Products Preparation Tool installs Windows Server
2008 SP2 automatically.
The preparation tool installs the following prerequisites:
-------------------------------------------------
Web Server (IIS) role
Application Server role
Microsoft .NET Framework version 3.5 SP1
SQL Server 2008 Express with SP1
Microsoft Sync Framework Runtime v1.0 (x64)
Microsoft Filter Pack 2.0
Microsoft Chart Controls for the Microsoft .NET Framework 3.5
Windows PowerShell 2.0
SQL Server 2008 Native Client
Microsoft SQL Server 2008 Analysis Services ADOMD.NET
ADO.NET Data Services Update for .NET Framework 3.5 SP1
A hotfix for the .NET Framework 3.5 SP1 that provides a method to support token authentication without transport security
or message encryption in WCF.
Windows Identity Foundation (WIF)
http://technet.microsoft.com/en-us/library/cc262485.aspx

Why SharePoint?

Why SharePoint?

For those not familiar, SharePoint is Microsoft’s collaboration platform for the enterprise and the web. It comes with a lot of out of the box (OOTB) tools for document management, collaboration, reporting and integration with other industry standard tools and technologies. In addition, there are a lot of third party products that are available to extend the capabilities of SharePoint.
SharePoint’s OOTB capabilities, in conjunction with its’ integration with existing and 3rd party tools, allows for rapid deployment of a project transparency solution.
What is SharePoint?
http://sharepoint.microsoft.com/en-us/product/capabilities/Pages/default.aspx

Friday, 25 April 2014

SharePoint Online 2013 Navigation is missing

SharePoint Online 2013 Navigation is missing
Your site is non-publishing site, so you will not able to see Navigation option
If you see a link titled Navigation, then you are working with a publishing site and you can configure your site using the Navigation Settings page.
If you see links titled Top link bar and Quick Launch, then you are working with a non-publishing site and you have a more limited set of navigation configuration options available to you.

I have full permission, but not able to Create Subsites in SharePoint Online

I have full permission, but not able to Create Subsites in SharePoint Online
Solution:
Settings-->Site Settings
Site Permissions
Click on Permission Levels (From top ribbon)
Click on Full Control hyperlink
Search for "Create Subsites"
Create Subsites -->Check box should be checked.

SharePoint 2013 Document Set Feature is missing

SharePoint 2013 Document Set Feature is missing
Open Site Collection
Site Settings-->Site Collection features
Document Sets
Click Activate
Now you will find document set option.

SharePoint 2013 REST API is not working

SharePoint 2013 REST API is not working
https://microsoft.sharepoint.com/teams/MyTeam/_api/web/
Some times you may not able to see anything.
The reason is browser settings
Click on Tools in the browser
Internet Options
Content Tab
Feeds and Web Slices
Settings
Uncheck (Turn on feed reading view)
now Open new browser
https://microsoft.sharepoint.com/teams/MyTeam/_api/web/

Error occurred in deployment step ‘Install app for SharePoint’: Sideloading of apps is not enabled on this site

Error occurred in deployment step ‘Install app for SharePoint’: Sideloading of apps is not enabled on this site
Root Cause:
Visual studio 2012 will complain about a missing feature if you attempt to deploy an application to a SharePoint site that is not created with the “Developer Site” template since it will be missing required lists and content types.
Solution:
Enable the Developer feature on your Site collection where you want to deploy and test your apps using Visual Studio. Since this feature is hidden you will not see it in the list of the site collection feature, so you will need to enable it using PowerShell:
Enable-SPFeature e374875e-06b6-11e0-b0fa-57f5dfd72085 -url http://contoso.com

Hide the Quick Launch in SharePoint 2013

Hide the Quick Launch in SharePoint 2013
1.Edit the page
2.Add a web part. Choose Script Editor from the Media and Content Category
3.Choose Edit Snippet
4.Paste below CSS
<style type="text/css">
#sideNavBox {
display: none;
}
#contentBox {
margin-left: 0px;
}
.ms-webpartPage-root {
border-spacing: 5px;
}
.ms-core-tableNoSpace.ms-webpartPage-root > tbody > tr > td > table
{
padding: 5px !important;
border-collapse: collapse;
}
</style>

good one: http://sharepointpromag.com/sharepoint/four-ways-add-or-remove-quick-launch-menu-control

display templates missing in SharePoint 2013

display templates missing in SharePoint 2013
Reason: If your Site collection is not Publishing Portal site collection, then you will not able to see display templates.
Solution:
Create a Publishing Site collection.
or
Enable publishing infrastructure feature

Design Manager is missing in SharePoint 2013

Design Manager is missing in SharePoint 2013
Reason: If your Site collection is not Publishing Portal site collection, then you will not able to see Design manager.
Solution:
Create a Publishing Site collection.
or
Enable publishing infrastructure feature

How to find SharePoint version number

How to find SharePoint version number
If you put this after your base SharePoint URL:
/_vti_pvt/service.cnf
you can find out the version number of SharePoint very quickly
Ex:
vti_encoding:SR|utf8-nl vti_extenderversion:SR|15.0.0.4420

Error: SP context not found

Error: SP context not found
Some time you will get SP context not found error, so it is always better use ExecuteOrDelayUntilScriptLoaded
Example:
$(document).ready(function(){
ExecuteOrDelayUntilScriptLoaded(startIt, "sp.js");
});
function startIt() {
var ObjContex = new SP.ClientContext.get_current();
var ObjSite = ObjContex.get_site();
var ObjWeb = ObjSite.get_rootWeb();
var ObjlstColle = ObjWeb.get_lists();
var thisList = ObjlstColle.getByTitle("MyListName");
var ObjcamlQry = new SP.CamlQuery();
ObjcamlQry.set_viewXml(......................);
var ObjItemColl = thisList.getItems(ObjcamlQry);
ObjContex.load(ObjItemColl);
}

C# browser maximize in page load

C# browser maximize in page load
protected void Page_Load(object sender, EventArgs e)
{
Page.RegisterClientScriptBlock(“”, “top.window.moveTo(0,0); top.window.resizeTo(screen.availWidth,screen.availHeight);”);
}

Copy dll from GAC

Get a copy of dll in GAC (or) add Reference to a dll in GACSometimes in .net application we need to have a copy of a dll which is available in GAC. But when we view the GAC through C:\Windows\assembly folder or Runà assembly.
Using this we cannot copy the dll. Only uninstall option is available.
To view the available dll using the naked eye follow the steps (to get the copy option or to copy the dll form Assembly folder)
Dot net have a dll file Shfusion.dll which is a Assembly Cache Viewer. It is located in the following path.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll
1. uninstall the dll using the following command in the run dialog box.
regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll
1. Now type assembly in the Run dialog box.
2. Now you will see the folder view of the GAC. copy the dll you want.
Note:
3. To get back to the previous state of view register the Shfusion dll using the following command
4. regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll
GAC:
c:\WINDOWS\assembly
and after it’s now here:
C:\WINDOWS\Microsoft.NET\assembly
==========================================
Or
===============================================
How to read dll from gac
copy dll from gac
copy dll from assembly
Go to Run
Type:
C:\windows\assembly\gac_msil
Now you can copy any dll.

SharePoint Add Test Data to List

SharePoint Add Test Data to List
If you want to add more data to list, you can use poershell.
Open Poweshell in administration mode.
Type below commands...

cls
Remove-PSSnapin Microsoft.SharePoint.Powershell
Add-PSSnapin Microsoft.SharePoint.Powershell
$webUrl = “http://SP2010";
$web = Get-SPWeb $webUrl;
$list = $web.Lists.TryGetList("MyListName");
(1..100)|%{
$ID=$item.ID;
$x=1;
$A=$ID+$x;
$item = $list.Items.Add();
$item["Title"]="Test";
$item["A"]=$A;
$item.Update();
$item.ID
}
$web.Dispose()

How to add smart Object in K2 Blackpearl?

How to add smart Object in K2 Blackpearl?
Open SmartObject Service Tester from below path.
“C:\Program Files (x86)\K2 blackpearl\Bin\ SmartObject Service Tester.exe”
Click on Service Object Explorer
Click on Any service-->Open Project-->Open folders-->Expand your stored procedure

Right Click on any stored procedure -->Create Smart Object
Enter Any Name
Select Category
Click “Publish Smart Object”
Close
How to Test Smart Object
Click on Smart Object Explorer in same window
Go to your category
Go to smart object which you create, If you are not able to find, just refresh the Service Object Tester.
Right Click on Smart Object-->Execute Smart Object
Click on Execute

jQuery Mega Menu

jQuery Mega Menu
Download:
jkmegamenu.css
jkmegamenu.js
from below site.
http://www.javascriptkit.com/script/script2/jkmegamenu.shtml
Add below code to your html page.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="jkmegamenu.css" />
<script type="text/javascript" src="jkmegamenu.js">
/***********************************************
* jQuery Mega Menu- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
//jkmegamenu.definemenu("anchorid", "menuid", "mouseover|click")
//jkmegamenu.definemenu("megaanchor", "megamenu1", "mouseover")
jkmegamenu.definemenu("megaanchor", "megamenu1", "click")
</script>
</head>
<body>
<!--Mega Menu Anchor-->
<a href="http://www.javascriptkit.com" id="megaanchor">Tech Links</a>
<!--Mega Drop Down Menu HTML. Retain given CSS classes-->
<div id="megamenu1" class="megamenu">
<div class="column">
<h3>Web Development</h3>
<ul>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.dynamicdrive.com/">Dynamic Drive</a></li>
<li><a href="http://www.cssdrive.com">CSS Drive</a></li>
<li><a href="http://www.codingforums.com">Coding Forums</a></li>
<li><a href="http://www.javascriptkit.com/domref/">DOM Reference</a></li>
</ul>
</div>
<div class="column">
<h3>News Related</h3>
<ul>
<li><a href="http://www.cnn.com/">CNN</a></li>
<li><a href="http://www.msnbc.com">MSNBC</a></li>
<li><a href="http://www.google.com">Google</a></li>
<li><a href="http://news.bbc.co.uk">BBC News</a></li>
</ul>
</div>
<div class="column">
<h3>Technology</h3>
<ul>
<li><a href="http://www.news.com/">News.com</a></li>
<li><a href="http://www.slashdot.com">SlashDot</a></li>
<li><a href="http://www.digg.com">Digg</a></li>
<li><a href="http://www.techcrunch.com">Tech Crunch</a></li>
</ul>
</div>
<br style="clear: left" /> <!--Break after 3rd column. Move this if desired-->
<div class="column">
<h3>Web Development</h3>
<ul>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.dynamicdrive.com/">Dynamic Drive</a></li>
<li><a href="http://www.cssdrive.com">CSS Drive</a></li>
<li><a href="http://www.codingforums.com">Coding Forums</a></li>
<li><a href="http://www.javascriptkit.com/domref/">DOM Reference</a></li>
</ul>
</div>
<div class="column">
<h3>News Related</h3>
<ul>
<li><a href="http://www.cnn.com/">CNN</a></li>
<li><a href="http://www.msnbc.com">MSNBC</a></li>
<li><a href="http://www.google.com">Google</a></li>
<li><a href="http://news.bbc.co.uk">BBC News</a></li>
</ul>
</div>
<div class="column">
<h3>Technology</h3>
<ul>
<li><a href="http://www.news.com/">News.com</a></li>
<li><a href="http://www.slashdot.com">SlashDot</a></li>
<li><a href="http://www.digg.com">Digg</a></li>
<li><a href="http://www.techcrunch.com">Tech Crunch</a></li>
</ul>
</div>
</div>
</body>
</html>

C# hyperlinks in one column of gridview

Asp.Net hyperlinks in one column of gridview

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gridV.aspx.cs" Inherits="testJS.gridV" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView4_RowDataBound">
<Columns>
<asp:BoundField DataField="Sno" HeaderText="Sno" />
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="GmailApplicable" HeaderText="GmailApplicable" />
<asp:BoundField DataField="YahooApplicable" HeaderText="YahooApplicable" />
<asp:BoundField DataField="FBApplicable" HeaderText="FBApplicable" />
<asp:TemplateField HeaderText="Links">
<ItemTemplate>
<table>
<tr>
<td>
<asp:HyperLink ID="hypGmail" runat="server">Gmail</asp:HyperLink>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="hypYahoo" runat="server">Yahoo</asp:HyperLink>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="hypFB" runat="server">FB</asp:HyperLink>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>

---------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace testJS
{
public partial class gridV : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadGrid();
}
}
private void LoadGrid()
{
DataTable dtEmployees = new DataTable();
dtEmployees.Columns.Add("Sno", typeof(int));
dtEmployees.Columns.Add("Name");
dtEmployees.Columns.Add("Age", typeof(int));
dtEmployees.Columns.Add("Salary", typeof(double));
dtEmployees.Columns.Add("GmailApplicable", typeof(bool));
dtEmployees.Columns.Add("YahooApplicable", typeof(bool));
dtEmployees.Columns.Add("FBApplicable", typeof(bool));
DataRow dr;
dr = dtEmployees.NewRow();
dr["Sno"] = 1;
dr["Name"] = "Google";
dr["Age"] = 28;
dr["Salary"] = 3000.00;
dr["GmailApplicable"] = true;
dr["YahooApplicable"] = false;
dr["FBApplicable"] = false;
dtEmployees.Rows.Add(dr);
dr = dtEmployees.NewRow();
dr["Sno"] = 2;
dr["Name"] = "Yahoo";
dr["Age"] = 28;
dr["Salary"] = 3200.00;
dr["GmailApplicable"] = false;
dr["YahooApplicable"] = true;
dr["FBApplicable"] = false;
dtEmployees.Rows.Add(dr);
dr = dtEmployees.NewRow();
dr["Sno"] = 3;
dr["Name"] = "FB";
dr["Age"] = 29;
dr["Salary"] = 8200.00; dr["GmailApplicable"] = false;
dr["YahooApplicable"] = false;
dr["FBApplicable"] = true;
dtEmployees.Rows.Add(dr);
GridView4.DataSource = dtEmployees;
GridView4.DataBind();
}
protected void GridView4_RowDataBound(object sender, GridViewRowEventArgs e)
{
/* If we set the Visible to false in aspx in Bound column This values will get binded. So we need to set the visibility in code behind*/
e.Row.Cells[2].Visible = false;
e.Row.Cells[3].Visible = false;
e.Row.Cells[4].Visible = false;
if (e.Row.RowType == DataControlRowType.DataRow)
{
bool bgmailApplicable = Convert.ToBoolean(e.Row.Cells[2].Text); //("GmailApplicable");
bool bYahooApplicable = Convert.ToBoolean(e.Row.Cells[3].Text);// .FindControl("YahooApplicable");
bool bFbApplicable = Convert.ToBoolean(e.Row.Cells[4].Text); //.FindControl("FbApplicable");
HyperLink hypGmail = (HyperLink)e.Row.Cells[5].FindControl("hypGmail");
if (bgmailApplicable)
{
hypGmail.NavigateUrl = "http://www.gmail.com";
hypGmail.Visible = true;
}
else
{
hypGmail.Visible = false;
}
HyperLink hypYahoo = (HyperLink)e.Row.Cells[5].FindControl("hypYahoo");
if (bYahooApplicable)
{
hypYahoo.NavigateUrl = "http://www.Yahoo.com";
hypYahoo.Visible = true;
}
else
{
hypYahoo.Visible = false;
}
HyperLink hypFB = (HyperLink)e.Row.Cells[5].FindControl("hypFB");
if (bFbApplicable)
{
hypFB.NavigateUrl = "http://www.fb.com";
hypFB.Visible = true;
}
else
{
hypFB.Visible = false;
}
}
}
}
}

Thursday, 24 April 2014

Convert ISO to EXE

Convert ISO to EXE
Steps
1:Install WinRAR (While Installing Select ISO option also)
2:Now your image will come in the form of RAR,
3. Extact now.
4. You have exe
5.Install
English WinRAR and RAR release
Download WinRAR
http://www.rarlab.com/download.htm

K2 Blackpearl start from Asp.net

K2 Blackpearl start from Asp.net

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
// C:\WINDOWS\assembly\GAC_32\SourceCode.Workflow.Client\4.0.0.0__16a2c5aaaa1b130d\SourceCode.Workflow.Client.dll
using SourceCode.Workflow.Client;
public partial class InitiatorRework : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Connection
k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
WorklistItem wli =
k2Conn.OpenWorklistItem(Request.QueryString["sn"]);
#region Bind Form Data from Data Fields
QuoteNumber.Text = wli.ProcessInstance.Folio;
Region.Text = wli.ProcessInstance.DataFields
["Region"].Value.ToString();
ReqFullName.Text = wli.ProcessInstance.DataFields
["OriginatorFullName"].Value.ToString();
ReqTitle.Text = wli.ProcessInstance.DataFields
["OriginatorTitle"].Value.ToString();
Email.Text = wli.ProcessInstance.DataFields
["OriginatorEmail"].Value.ToString();
Username.Text = wli.ProcessInstance.DataFields
["OriginatorUsername"].Value.ToString();
TransactionType.SelectedValue = wli.ProcessInstance.DataFields
["TransactionType"].Value.ToString();
NumPayees.Text = wli.ProcessInstance.DataFields
["NumPayees"].Value.ToString();
CustomerName.SelectedValue = wli.ProcessInstance.DataFields
["CustomerName"].Value.ToString();
PrimaryBusiness.Text = wli.ProcessInstance.DataFields
["PrimaryBusiness"].Value.ToString();
AnnualRevenue.Text = wli.ProcessInstance.DataFields
["AnnualRevenue"].Value.ToString();
PricingList.Text = wli.ProcessInstance.DataFields
["PricingList"].Value.ToString();
PricingNet.Text = wli.ProcessInstance.DataFields
["PricingNet"].Value.ToString();
PricingDiscount.Text = wli.ProcessInstance.DataFields
["PricingDiscount"].Value.ToString();
Maintenance.SelectedValue = wli.ProcessInstance.DataFields
["Maintenance"].Value.ToString();
FirstYearRate.Text = wli.ProcessInstance.DataFields
["FirstYearRate"].Value.ToString();
RenewalRate.Text = wli.ProcessInstance.DataFields
["RenewalRate"].Value.ToString();
Competition.Text = wli.ProcessInstance.DataFields
["Competition"].Value.ToString();
ClientBudget.Text = wli.ProcessInstance.DataFields
["ClientBudget"].Value.ToString();
ApproximateCloseDate.Text = wli.ProcessInstance.DataFields
["ApproximateCloseDate"].Value.ToString();
OutsideFinancingOffered.Text = wli.ProcessInstance.DataFields
["OutsideFinancingOffered"].Value.ToString();
ServicesTraining.Text = wli.ProcessInstance.DataFields
["ServicesTraining"].Value.ToString();
ServicesConsulting.Text = wli.ProcessInstance.DataFields
["ServicesConsulting"].Value.ToString();
ReqComments.Text = wli.ProcessInstance.DataFields
["OriginatorComments"].Value.ToString();
ApprovalHistory.Text = wli.ProcessInstance.DataFields
["ApprovalHistory"].Value.ToString().Replace(System.Environment.NewLine, "
");
string[] ModulesList =
wli.ProcessInstance.DataFields["ModulesRequested"].Value.ToString().Replace(", ", ",").Split(',');
for (int
i = 0; i < ModulesList.Length; i++)
{
foreach (ListItem item in ModulesRequested.Items)
{
if (item.Value == ModulesList[i])
{
item.Selected = true;
}
}
}
#endregion
}
catch (Exception exception)
{
Response.Write("
Error: " +
exception.Message);
}
finally
{
k2Conn.Close();
}
}
}
protected void btnResubmit_Click(object sender, EventArgs e)
{
ProcessAction("Resubmitted");
}
protected
void btnCancel_Click(object sender, EventArgs e)
{
ProcessAction("Cancelled");
}
private void ProcessAction(string actionName)
{
Connection k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
WorklistItem wli = k2Conn.OpenWorklistItem(Request.QueryString["sn"]);
#region Update Approval History
wli.ProcessInstance.DataFields["ApprovalHistory"].Value += DateTime.Today.ToShortDateString() + ": " + actionName + " by " +
k2Conn.User.Name.Replace("DENALLIX\\", "") + " - " + ReworkComments.Text + System.Environment.NewLine + System.Environment.NewLine;
#endregion
wli.Actions[actionName].Execute();
Response.Redirect("ThankYou.aspx");
}
catch (Exception exception)
{
Response.Write("
Error: " + exception.Message);
}
finally
{
k2Conn.Close();
}
}
}
============================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
// C:\WINDOWS\assembly\GAC_32\SourceCode.Workflow.Client\4.0.0.0__16a2c5aaaa1b130d\SourceCode.Workflow.Client.dll
using SourceCode.Workflow.Client;
using SourceCode.SmartObjects.Client;
using System.Web.Mobile;
using System.Xml;
public partial class Approval : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MobileCapabilities browserObj = (MobileCapabilities)Request.Browser;
if (browserObj.IsMobileDevice)
{
Response.Redirect("MobileApproval.aspx?sn=" + Request.QueryString["sn"]);
}
else if (!Page.IsPostBack)
{
Connection k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
WorklistItem wli = k2Conn.OpenWorklistItem(Request.QueryString["sn"]);
#region Bind Form Data from Xml Data Fields
QuoteNumber.Text = wli.ProcessInstance.Folio;
XmlDocument xmlDoc = new XmlDocument();
// load the .NET XML doc With the contents Of this K2 XML field
xmlDoc.LoadXml(wli.ProcessInstance.XmlFields["QuoteApprovalForm"].Value.ToString());
XmlNamespaceManager nsMgr = new XmlNamespaceManager(xmlDoc.NameTable);
nsMgr.AddNamespace("my", xmlDoc.DocumentElement.GetNamespaceOfPrefix("my"));
Region.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteInformation/my:Region", nsMgr).InnerText;
ReqFullName.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteInformation/my:FullName", nsMgr).InnerText;
ReqTitle.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteInformation/my:Title", nsMgr).InnerText;
Email.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteInformation/my:Email", nsMgr).InnerText;
Username.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteInformation/my:Username", nsMgr).InnerText;
TransactionType.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:TransactionType", nsMgr).InnerText;
NumPayees.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:NumPayees", nsMgr).InnerText;
CustomerName.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:CustomerName", nsMgr).InnerText;
PrimaryBusiness.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:PrimaryBusiness", nsMgr).InnerText;
AnnualRevenue.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:AnnualRevenue", nsMgr).InnerText;
CustomerContact.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:CustomerContact", nsMgr).InnerText;
ContactEmail.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:ContactEmail", nsMgr).InnerText;
PricingList.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:PricingList", nsMgr).InnerText;
PricingNet.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:PricingNet", nsMgr).InnerText;
PricingDiscount.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:PricingDiscount", nsMgr).InnerText;
Maintenance.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:Maintenance", nsMgr).InnerText;
FirstYearRate.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:FirstYearRate", nsMgr).InnerText;
RenewalRate.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:RenewalRate", nsMgr).InnerText;
Competition.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsCompetition", nsMgr).InnerText;
ClientBudget.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:ClientBudget", nsMgr).InnerText;
ApproximateCloseDate.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:ApproximateCloseDate", nsMgr).InnerText;
OutsideFinancingOffered.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsOutsideFinanceOffered", nsMgr).InnerText;
ServicesTraining.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:ServicesTraining", nsMgr).InnerText;
ServicesConsulting.Text = xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:ServicesConsulting", nsMgr).InnerText;
OriginatorComments.Text = xmlDoc.SelectSingleNode("//my:myFields/my:AdditionalComments", nsMgr).InnerText;
if (xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsModuleServer", nsMgr).InnerText == "yes")
ModulesRequested.Text += "Server
";
if (xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsModuleClient", nsMgr).InnerText == "yes")
ModulesRequested.Text += "Client
";
if (xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsModuleArchive", nsMgr).InnerText == "yes")
ModulesRequested.Text += "Archiving
";
if (xmlDoc.SelectSingleNode("//my:myFields/my:QuoteDetails/my:IsModuleManagement", nsMgr).InnerText == "yes")
ModulesRequested.Text += "Management
";
#endregion
#region Load Process Bar according to ActivityInstanceDestination.Name
if (Convert.ToInt32(PricingDiscount.Text) < 200000)
{
if (wli.ActivityInstanceDestination.Name.Equals("Regional VP Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_noCFO/pb_reg_dir_approval_noCFO.jpg";
imgApprovalHistory.Visible = false;
}
else if (wli.ActivityInstanceDestination.Name.Equals("VP Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_noCFO/pb_vp_approval_noCFO.jpg";
}
else if (wli.ActivityInstanceDestination.Name.Equals("Legal Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_noCFO/pb_legal_approval_noCFO.jpg";
}
}
else
{
if (wli.ActivityInstanceDestination.Name.Equals("Regional VP Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_CFO/pb_reg_dir_approval.jpg";
imgApprovalHistory.Visible = false;
}
else if (wli.ActivityInstanceDestination.Name.Equals("VP Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_CFO/pb_vp_approval.jpg";
}
else if (wli.ActivityInstanceDestination.Name.Equals("Legal Approval"))
{
imgProcessBar.ImageUrl = "Images/process_bar_CFO/pb_legal_approval.jpg";
}
else
{
imgProcessBar.ImageUrl = "Images/process_bar_CFO/pb_cfo_approval.jpg";
}
}
#endregion
}
catch (Exception exception)
{
Response.Write("
Error: " + exception.Message);
}
finally
{
k2Conn.Close();
}
}
}
protected void imgbtnApprove_Click(object sender, ImageClickEventArgs e)
{
ProcessAction("Approved");
}
protected void imgbtnReject_Click(object sender, ImageClickEventArgs e)
{
ProcessAction("Rejected");
}
private void ProcessAction(string actionName)
{
Connection k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
WorklistItem wli = k2Conn.OpenWorklistItem(Request.QueryString["sn"]);
#region Connect to SO Server for Employee Information
SmartObjectClientServer soClient = new SmartObjectClientServer();
soClient.Connection = soClient.CreateConnection();
if (soClient.Connection.IsConnected == false)
{
//Very Important, use connection string builder to create connection string.
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionStr = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
connectionStr.Host = "dlx";
connectionStr.Integrated = true;
connectionStr.IsPrimaryLogin = true;
connectionStr.Port = 5555;
//Open connection
//Need method to handle closing of the connection when required - not implemented
try
{
soClient.Connection.Open(connectionStr.ConnectionString);
}
catch (Exception ex)
{
Response.Write("
Error: " + ex.Message);
}
}
#endregion
#region Load Employee Information
SmartObject soEmployee = soClient.GetSmartObject("Employee");
soEmployee.MethodToExecute = "Load";
string sUser = HttpContext.Current.User.Identity.Name;
sUser = sUser.Replace("DENALLIX\\", string.Empty);
soEmployee.Properties["EmployeeID"].Value = sUser; //k2Conn.User.Name.Replace("DENALLIX\\", "");
soClient.ExecuteScalar(soEmployee);
#endregion
#region Save Approval History
string approver = soEmployee.Properties["FullName"].Value.ToString();
DateTime approvalDate = DateTime.Now;
SmartObject soComment = soClient.GetSmartObject("QuoteComment");
soComment.MethodToExecute = "Create";
soComment.Properties["QuoteID"].Value = QuoteNumber.Text;
soComment.Properties["EmployeeID"].Value = k2Conn.User.Name.Replace("DENALLIX\\", "");
soComment.Properties["FullName"].Value = approver;
soComment.Properties["CommentDate"].Value = approvalDate.ToString();
soComment.Properties["Comment"].Value = ApprovalComments.Text;
soComment.Properties["Action"].Value = actionName;
soClient.ExecuteScalar(soComment);
#endregion
wli.Actions[actionName].Execute();
Response.Redirect("ThankYou.aspx?ProcessStage=" + imgProcessBar.ImageUrl);
}
catch (Exception exception)
{
Response.Write("
Error: " + exception.Message);
}
finally
{
k2Conn.Close();
}
}
}
========================
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
// C:\WINDOWS\assembly\GAC_32\SourceCode.Workflow.Client\4.0.0.0__16a2c5aaaa1b130d\SourceCode.Workflow.Client.dll
using SourceCode.Workflow.Client;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Request.ServerVariables["LOGON_USER"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Connection k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
ProcessInstance pi = k2Conn.CreateProcessInstance("SAPIDRequestSystem\\SAPID");
#region Bind Data Fields from Form Data
pi.DataFields["SAPStatus"].Value = Label1.Text;
pi.Folio = "SQLStar" + System.DateTime.Now;
#endregion
k2Conn.StartProcessInstance(pi);
Label1.Text = "Success";
}
catch (Exception exception)
{
Response.Write("
Error: " + exception.Message);
}
finally
{
k2Conn.Close();
}
}
}
==========================
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SourceCode.SmartObjects.Client;
// C:\WINDOWS\assembly\GAC_32\SourceCode.Workflow.Client\4.0.0.0__16a2c5aaaa1b130d\SourceCode.Workflow.Client.dll
using SourceCode.Workflow.Client;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
#region Connect to SO Server for Employee Information
SmartObjectClientServer soClient = new SmartObjectClientServer();
soClient.Connection = soClient.CreateConnection();
if (soClient.Connection.IsConnected == false)
{
//Very Important, use connection string builder to create connection string.
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionStr = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
connectionStr.Host = "dlx";
connectionStr.Integrated = true;
connectionStr.IsPrimaryLogin = true;
connectionStr.Port = 5555;
//Open connection
//Need method to handle closing of the connection when required - not implemented
try
{
soClient.Connection.Open(connectionStr.ConnectionString);
}
catch (Exception ex)
{
Response.Write("
Error: " + ex.Message);
}
}
#endregion
#region Load Employee Information
SmartObject soEmployee = soClient.GetSmartObject("NewEmployee");
soEmployee.MethodToExecute = "Load";
soEmployee.Properties["Username"].Value = System.Environment.UserName;
soClient.ExecuteScalar(soEmployee);
#endregion
#region Bind Employee Information with Form Data
Username.Text = soEmployee.Properties["Username"].Value.ToString();
ReqFullName.Text = soEmployee.Properties["name"].Value.ToString();
ReqTitle.Text = soEmployee.Properties["description"].Value.ToString();
Email.Text = soEmployee.Properties["mail"].Value.ToString();
Region.Text = soEmployee.Properties["Region"].Value.ToString();
#endregion
ApproximateCloseDate.Text = DateTime.Today.AddDays(14).ToShortDateString();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Connection k2Conn = new Connection();
try
{
k2Conn.Open("DLX");
ProcessInstance pi = k2Conn.CreateProcessInstance("Processes\\Pricing Approval");
#region Bind Data Fields from Form Data
pi.DataFields["Region"].Value = Region.Text;
pi.DataFields["TransactionType"].Value = TransactionType.SelectedValue;
pi.DataFields["NumPayees"].Value = Convert.ToInt32(NumPayees.Text);
pi.DataFields["CustomerName"].Value = CustomerName.SelectedValue;
pi.DataFields["PrimaryBusiness"].Value = PrimaryBusiness.Text;
pi.DataFields["AnnualRevenue"].Value = Convert.ToInt32(AnnualRevenue.Text);
pi.DataFields["PricingList"].Value = Convert.ToInt32(PricingList.Text);
pi.DataFields["PricingNet"].Value = Convert.ToInt32(PricingNet.Text);
pi.DataFields["PricingDiscount"].Value = Convert.ToInt32(PricingDiscount.Text);
pi.DataFields["Maintenance"].Value = Maintenance.SelectedValue;
pi.DataFields["FirstYearRate"].Value = Convert.ToInt32(FirstYearRate.Text);
pi.DataFields["RenewalRate"].Value = Convert.ToInt32(RenewalRate.Text);
pi.DataFields["Competition"].Value = Competition.Text;
pi.DataFields["ClientBudget"].Value = ClientBudget.Text;
pi.DataFields["ApproximateCloseDate"].Value = Convert.ToDateTime(ApproximateCloseDate.Text).ToShortDateString();
pi.DataFields["OutsideFinancingOffered"].Value = OutsideFinancingOffered.Text;
pi.DataFields["ServicesTraining"].Value = ServicesTraining.Text;
pi.DataFields["ServicesConsulting"].Value = ServicesConsulting.Text;
pi.DataFields["OriginatorComments"].Value = ReqComments.Text;
pi.DataFields["OriginatorUsername"].Value = Username.Text;
pi.DataFields["OriginatorEmail"].Value = Email.Text;
pi.DataFields["OriginatorTitle"].Value = ReqTitle.Text;
pi.DataFields["OriginatorFullName"].Value = ReqFullName.Text;
foreach (ListItem item in ModulesRequested.Items)
{
if (item.Selected == true)
{
pi.DataFields["ModulesRequested"].Value += item.Value + ", ";
}
}
pi.DataFields["ModulesRequested"].Value = pi.DataFields["ModulesRequested"].Value.ToString().Trim().TrimEnd(',');
#endregion
k2Conn.StartProcessInstance(pi);
}
catch (Exception exception)
{
Response.Write("
Error: " + exception.Message);
}
finally
{
k2Conn.Close();
}
}
}