the following function will take an User Name as a parameter and will return the section for the user--------------------------------------------------------------
private string GetSectionByUserName(string userName)
{
string section = string.Empty;
SPList userList = SPContext.Current.Web.SiteUserInfoList;
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Author'/><Value Type='Text'>"+ userName + "</Value></Eq></Where>";
SPListItemCollection itemCollection = userList.GetItems(query);
if (itemCollection.Count > 0)
{
section = itemCollection[0]["Section"].ToString();
}
return section;
}
Subscribe to:
Posts (Atom)
5 Strategies for Getting More Work Done in Less Time
Summary. You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...
-
Imagine going to work everyday and facing a colleague who does not respect you or having to work with someone who was constantly underminin...
-
Sometimes just to get a quick success build you might need to disable/ignore/skip some of the munit test cases. you can do you by double ...
-
Install ActiveMQ Step 1: Download Apache Active MQ 5.x.x (5.15.8 Latest Version Up to Feb 2019) Step 2: Install ActiveMQ Run the Active...