本文整理汇总了C#中SobekCM.Library.Users.User_Object.Remove_From_Bookshelves方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Remove_From_Bookshelves方法的具体用法?C# User_Object.Remove_From_Bookshelves怎么用?C# User_Object.Remove_From_Bookshelves使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM.Library.Users.User_Object
的用法示例。
在下文中一共展示了User_Object.Remove_From_Bookshelves方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Item_HtmlSubwriter
//.........这里部分代码省略.........
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
{
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "ERROR encountered while trying to remove item from your bookshelves.");
}
HttpContext.Current.Response.Redirect(HttpContext.Current.Items["Original_URL"].ToString(), false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
Current_Mode.Request_Completed = true;
return;
}
if (action.IndexOf("add_tag") == 0)
{
int tagid = -1;
if (action.Replace("add_tag", "").Length > 0)
{
tagid = Convert.ToInt32(action.Replace("add_tag_", ""));
}
string description = HttpContext.Current.Request.Form["add_tag"].Trim();
int new_tagid = SobekCM_Database.Add_Description_Tag(currentUser.UserID, tagid, currentItem.Web.ItemID, description, Tracer);
if (new_tagid > 0)
{
currentItem.Behaviors.Add_User_Tag(currentUser.UserID, currentUser.Full_Name, description, DateTime.Now, new_tagid);
currentUser.Has_Descriptive_Tags = true;
}
HttpContext.Current.Response.Redirect(HttpContext.Current.Items["Original_URL"].ToString(), false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
Current_Mode.Request_Completed = true;