public static SPUser GetSPUser(SPWeb web,string userName)
{
SPUser user=web.EnsureUser(userName);
return user;
}
public static int ParseLookupId(string fieldValue,SPList list,string fieldName)
{
int lookUpID = 0;
try
{
foreach (SPListItem item in list.Items)
{
if (item[fieldName].ToString()==fieldValue)
{
lookUpID = int.Parse(item["ID"].ToString());
}
}
}
catch (Exception)
{
throw;
}
return lookUpID;
}