本文整理汇总了C#中SobekCM.Library.Users.User_Object.Add_Bookshelf_Item方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Add_Bookshelf_Item方法的具体用法?C# User_Object.Add_Bookshelf_Item怎么用?C# User_Object.Add_Bookshelf_Item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM.Library.Users.User_Object
的用法示例。
在下文中一共展示了User_Object.Add_Bookshelf_Item方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: build_user_object_from_dataset
//.........这里部分代码省略.........
user.Department = userRow["Department"].ToString();
user.College = userRow["College"].ToString();
user.Unit = userRow["Unit"].ToString();
user.Default_Rights = userRow["Rights"].ToString();
user.Preferred_Language = userRow["Language"].ToString();
user.Is_Internal_User = Convert.ToBoolean(userRow["Internal_User"]);
user.Edit_Template_Code = userRow["EditTemplate"].ToString();
user.Edit_Template_MARC_Code = userRow["EditTemplateMarc"].ToString();
user.Can_Delete_All = Convert.ToBoolean(userRow["Can_Delete_All_Items"]);
user.Is_System_Admin = Convert.ToBoolean(userRow["IsSystemAdmin"]);
user.Is_Portal_Admin = Convert.ToBoolean(userRow["IsPortalAdmin"]);
user.Include_Tracking_In_Standard_Forms = Convert.ToBoolean(userRow["Include_Tracking_Standard_Forms"]);
user.Receive_Stats_Emails = Convert.ToBoolean(userRow["Receive_Stats_Emails"]);
user.Has_Item_Stats = Convert.ToBoolean(userRow["Has_Item_Stats"]);
user.LoggedOn = true;
user.Internal_Notes = userRow["InternalNotes"].ToString();
user.Processing_Technician = Convert.ToBoolean(userRow["ProcessingTechnician"]);
user.Scanning_Technician = Convert.ToBoolean(userRow["ScanningTechnician"]);
if (Convert.ToInt32(userRow["descriptions"]) > 0)
user.Has_Descriptive_Tags = true;
foreach (DataRow thisRow in ResultSet.Tables[1].Rows)
{
user.Add_Template(thisRow["TemplateCode"].ToString(), Convert.ToBoolean(thisRow["GroupDefined"].ToString()));
}
foreach (DataRow thisRow in ResultSet.Tables[2].Rows)
{
user.Add_Default_Metadata_Set(thisRow["MetadataCode"].ToString(), Convert.ToBoolean(thisRow["GroupDefined"].ToString()));
}
user.Items_Submitted_Count = ResultSet.Tables[3 ].Rows.Count;
foreach (DataRow thisRow in ResultSet.Tables[3 ].Rows)
{
if (!user.BibIDs.Contains(thisRow["BibID"].ToString().ToUpper()))
user.Add_BibID(thisRow["BibID"].ToString().ToUpper());
}
// Add links to regular expressions
foreach (DataRow thisRow in ResultSet.Tables[4 ].Rows)
{
user.Add_Editable_Regular_Expression(thisRow["EditableRegex"].ToString());
}
// Add links to aggregations
foreach (DataRow thisRow in ResultSet.Tables[5 ].Rows)
{
user.Add_Aggregation(thisRow["Code"].ToString(), thisRow["Name"].ToString(), Convert.ToBoolean(thisRow["CanSelect"]), Convert.ToBoolean(thisRow["CanEditMetadata"]), Convert.ToBoolean(thisRow["CanEditBehaviors"]), Convert.ToBoolean(thisRow["CanPerformQc"]), Convert.ToBoolean(thisRow["CanUploadFiles"]), Convert.ToBoolean(thisRow["CanChangeVisibility"]), Convert.ToBoolean(thisRow["CanDelete"]), Convert.ToBoolean(thisRow["IsCollectionManager"]), Convert.ToBoolean(thisRow["OnHomePage"]), Convert.ToBoolean(thisRow["IsAggregationAdmin"]), Convert.ToBoolean(thisRow["GroupDefined"]));
}
// Add the current folder names
Dictionary<int, User_Folder> folderNodes = new Dictionary<int, User_Folder>();
List<User_Folder> parentNodes = new List<User_Folder>();
foreach (DataRow folderRow in ResultSet.Tables[6 ].Rows)
{
string folderName = folderRow["FolderName"].ToString();
int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
bool isPublic = Convert.ToBoolean(folderRow["isPublic"]);
User_Folder newFolderNode = new User_Folder(folderName, folderid) {isPublic = isPublic};
if (parentid == -1)
parentNodes.Add(newFolderNode);
folderNodes.Add(folderid, newFolderNode);
}
foreach (DataRow folderRow in ResultSet.Tables[6 ].Rows)
{
int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
if (parentid > 0)
{
folderNodes[parentid].Add_Child_Folder(folderNodes[folderid]);
}
}
foreach (User_Folder rootFolder in parentNodes)
user.Add_Folder(rootFolder);
// Get the list of BibID/VID associated with this
foreach (DataRow itemRow in ResultSet.Tables[7 ].Rows)
{
user.Add_Bookshelf_Item(itemRow["BibID"].ToString(), itemRow["VID"].ToString());
}
// Add the user groups to which this user is a member
foreach (DataRow groupRow in ResultSet.Tables[8].Rows)
{
user.Add_User_Group(groupRow[0].ToString());
}
// Get all the user settings
foreach (DataRow settingRow in ResultSet.Tables[9].Rows)
{
user.Add_Setting(settingRow["Setting_Key"].ToString(), settingRow["Setting_Value"].ToString(), false);
}
return user;
}
示例2: Item_HtmlSubwriter
//.........这里部分代码省略.........
{
string address = HttpContext.Current.Request.Form["email_address"].Replace(";", ",").Trim();
string comments = HttpContext.Current.Request.Form["email_comments"].Trim();
string format = HttpContext.Current.Request.Form["email_format"].Trim().ToUpper();
if (address.Length > 0)
{
// Determine the email format
bool is_html_format = format != "TEXT";
// CC: the user, unless they are already on the list
string cc_list = currentUser.Email;
if (address.ToUpper().IndexOf(currentUser.Email.ToUpper()) >= 0)
cc_list = String.Empty;
// Send the email
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", !Item_Email_Helper.Send_Email(address, cc_list, comments, currentUser.Full_Name,currentMode.SobekCM_Instance_Abbreviation,currentItem,is_html_format,HttpContext.Current.Items["Original_URL"].ToString(), currentUser.UserID)
? "Error encountered while sending email" : "Your email has been sent");
HttpContext.Current.Response.Redirect( HttpContext.Current.Items["Original_URL"].ToString(), false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
Current_Mode.Request_Completed = true;
return;
}
}
if (action == "add_item")
{
string usernotes = HttpContext.Current.Request.Form["add_notes"].Trim();
string foldername = HttpContext.Current.Request.Form["add_bookshelf"].Trim();
bool open_bookshelf = HttpContext.Current.Request.Form["open_bookshelf"] != null;
if (SobekCM_Database.Add_Item_To_User_Folder(currentUser.UserID, foldername, currentItem.BibID, currentItem.VID, 0, usernotes, Tracer))
{
currentUser.Add_Bookshelf_Item(currentItem.BibID, currentItem.VID);
// Ensure this user folder is not sitting in the cache
Cached_Data_Manager.Remove_User_Folder_Browse(currentUser.UserID, foldername, Tracer);
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Item was saved to your bookshelf.");
if (open_bookshelf)
{
HttpContext.Current.Session.Add("ON_LOAD_WINDOW", "?m=lmfl" + foldername.Replace("\"", "%22").Replace("'", "%27").Replace("=", "%3D").Replace("&", "%26") + "&vp=1");
}
}
else
{
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "ERROR encountered while trying to save to your bookshelf.");
}
HttpContext.Current.Response.Redirect(HttpContext.Current.Items["Original_URL"].ToString(), false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
Current_Mode.Request_Completed = true;
return;
}
if (action == "remove")
{
if (SobekCM_Database.Delete_Item_From_User_Folders(currentUser.UserID, currentItem.BibID, currentItem.VID, Tracer))
{
currentUser.Remove_From_Bookshelves(currentItem.BibID, currentItem.VID);
Cached_Data_Manager.Remove_All_User_Folder_Browses(currentUser.UserID, Tracer);
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Item was removed from your bookshelves.");
}
else
{
示例3: build_user_object_from_dataset
private static User_Object build_user_object_from_dataset(DataSet resultSet )
{
User_Object user = new User_Object();
DataRow userRow = resultSet.Tables[0].Rows[0];
user.UFID = userRow["UFID"].ToString();
user.UserID = Convert.ToInt32(userRow["UserID"]);
user.UserName = userRow["username"].ToString();
user.Email = userRow["EmailAddress"].ToString();
user.Given_Name = userRow["FirstName"].ToString();
user.Family_Name = userRow["LastName"].ToString();
user.Send_Email_On_Submission = Convert.ToBoolean(userRow["SendEmailOnSubmission"]);
user.Can_Submit = Convert.ToBoolean(userRow["Can_Submit_Items"]);
user.Is_Temporary_Password = Convert.ToBoolean(userRow["isTemporary_Password"]);
user.Nickname = userRow["Nickname"].ToString();
user.Organization = userRow["Organization"].ToString();
user.Organization_Code = userRow["OrganizationCode"].ToString();
user.Department = userRow["Department"].ToString();
user.College = userRow["College"].ToString();
user.Unit = userRow["Unit"].ToString();
user.Default_Rights = userRow["Rights"].ToString();
user.Preferred_Language = userRow["Language"].ToString();
user.Is_Internal_User = Convert.ToBoolean(userRow["Internal_User"]);
user.Edit_Template_Code = userRow["EditTemplate"].ToString();
user.Edit_Template_MARC_Code = userRow["EditTemplateMarc"].ToString();
user.Is_System_Admin = Convert.ToBoolean(userRow["IsSystemAdmin"]);
user.Is_Portal_Admin = Convert.ToBoolean(userRow["IsPortalAdmin"]);
user.Include_Tracking_In_Standard_Forms = Convert.ToBoolean(userRow["Include_Tracking_Standard_Forms"]);
user.Receive_Stats_Emails = Convert.ToBoolean(userRow["Receive_Stats_Emails"]);
user.Has_Item_Stats = Convert.ToBoolean(userRow["Has_Item_Stats"]);
if (Convert.ToInt32(userRow["descriptions"]) > 0)
user.Has_Descriptive_Tags = true;
foreach (DataRow thisRow in resultSet.Tables[1].Rows)
{
user.Add_Template(thisRow["TemplateCode"].ToString());
}
foreach (DataRow thisRow in resultSet.Tables[2].Rows)
{
user.Add_Project(thisRow["ProjectCode"].ToString());
}
user.Items_Submitted_Count = resultSet.Tables[3 ].Rows.Count;
foreach (DataRow thisRow in resultSet.Tables[3 ].Rows)
{
if (!user.BibIDs.Contains(thisRow["BibID"].ToString().ToUpper()))
user.Add_BibID(thisRow["BibID"].ToString().ToUpper());
}
// Add links to regular expressions
foreach (DataRow thisRow in resultSet.Tables[4 ].Rows)
{
user.Add_Editable_Regular_Expression(thisRow["EditableRegex"].ToString());
}
// Add links to aggregations
foreach (DataRow thisRow in resultSet.Tables[5 ].Rows)
{
user.Add_Aggregation(thisRow["Code"].ToString(), thisRow["Name"].ToString(), Convert.ToBoolean(thisRow["CanSelect"]), Convert.ToBoolean(thisRow["CanEditItems"]), Convert.ToBoolean(thisRow["IsAggregationAdmin"]), Convert.ToBoolean(thisRow["OnHomePage"]));
}
// Add the current folder names
Dictionary<int, User_Folder> folderNodes = new Dictionary<int, User_Folder>();
List<User_Folder> parentNodes = new List<User_Folder>();
foreach (DataRow folderRow in resultSet.Tables[6 ].Rows)
{
string folderName = folderRow["FolderName"].ToString();
int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
bool isPublic = Convert.ToBoolean(folderRow["isPublic"]);
User_Folder newFolderNode = new User_Folder(folderName, folderid) {isPublic = isPublic};
if (parentid == -1)
parentNodes.Add(newFolderNode);
folderNodes.Add(folderid, newFolderNode);
}
foreach (DataRow folderRow in resultSet.Tables[6 ].Rows)
{
int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
if (parentid > 0)
{
folderNodes[parentid].Add_Child_Folder(folderNodes[folderid]);
}
}
foreach (User_Folder rootFolder in parentNodes)
user.Add_Folder(rootFolder);
foreach (DataRow itemRow in resultSet.Tables[7 ].Rows)
{
user.Add_Bookshelf_Item(itemRow["BibID"].ToString(), itemRow["VID"].ToString());
}
foreach (DataRow groupRow in resultSet.Tables[8].Rows)
{
user.Add_User_Group(groupRow[0].ToString());
}
//.........这里部分代码省略.........