SPUser and LookUp Field update values
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;
}
专注于互联网、物联网技术架构及管理
https://www.cnblogs.com/csts