/// <summary> Constructor for a new instance of the Saved_Searches_MySobekViewer class </summary> /// <param name="User"> Authenticated user information </param> /// <param name="Translator"> Translation / language support object for writing the user interface is multiple languages</param> /// <param name="currentMode"> Mode / navigation information for the current request</param> /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param> public Saved_Searches_MySobekViewer(User_Object User, Language_Support_Info Translator, SobekCM_Navigation_Object currentMode, Custom_Tracer Tracer) : base(User) { Tracer.Add_Trace("Saved_Searches_MySobekViewer.Constructor", String.Empty); user = User; base.Translator = Translator; if (currentMode.isPostBack) { // Pull the standard values NameValueCollection form = HttpContext.Current.Request.Form; string item_action = form["item_action"].ToUpper().Trim(); string folder_id = form["folder_id"].Trim(); if (item_action == "REMOVE") { int folder_id_int; if (Int32.TryParse(folder_id, out folder_id_int)) { SobekCM_Database.Delete_User_Search(folder_id_int, Tracer); } } HttpContext.Current.Response.Redirect(HttpContext.Current.Items["Original_URL"].ToString()); } }
/// <summary> Constructor for a new instance of the Saved_Searches_MySobekViewer class </summary> /// <param name="RequestSpecificValues"> All the necessary, non-global data specific to the current request </param> public Saved_Searches_MySobekViewer(RequestCache RequestSpecificValues) : base(RequestSpecificValues) { RequestSpecificValues.Tracer.Add_Trace("Saved_Searches_MySobekViewer.Constructor", String.Empty); if (RequestSpecificValues.Current_Mode.isPostBack) { // Pull the standard values NameValueCollection form = HttpContext.Current.Request.Form; string item_action = form["item_action"].ToUpper().Trim(); string folder_id = form["folder_id"].Trim(); if (item_action == "REMOVE") { int folder_id_int; if (Int32.TryParse(folder_id, out folder_id_int)) { SobekCM_Database.Delete_User_Search(folder_id_int, RequestSpecificValues.Tracer); } } HttpContext.Current.Response.Redirect(HttpContext.Current.Items["Original_URL"].ToString(), false); HttpContext.Current.ApplicationInstance.CompleteRequest(); RequestSpecificValues.Current_Mode.Request_Completed = true; } }