protected void linkButtonFavoritesRemoveListing_Click(object sender, EventArgs e) { try { int MLSnumber = 0; LinkButton myButton = sender as LinkButton; if (myButton != null) { MLSnumber = Convert.ToInt32(myButton.CommandArgument); } FlexMLSController controller = new FlexMLSController(); FlexMLSInfo item = new FlexMLSInfo(); item.Favorite = MLSnumber.ToString(); item.FavoriteType = "Listing"; item.ModuleId = this.ModuleId; item.UserID = this.UserId; controller.FlexMLS_Favorites_Add(item); myButton.Text = "SAVED! - " + item.Favorite.ToString(); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
//linkButtonFavoritesAddListing_Click protected void linkButtonFavoritesAddListing_Click(object sender, EventArgs e) { try { int MLSnumber = 0; if (Request.IsAuthenticated) { LinkButton myButton = sender as LinkButton; if (myButton != null) { MLSnumber = Convert.ToInt32(myButton.CommandArgument); } FlexMLSController controller = new FlexMLSController(); FlexMLSInfo item = new FlexMLSInfo(); item.Favorite = MLSnumber.ToString(); item.FavoriteType = "Listing"; item.ModuleId = this.ModuleId; item.UserID = this.UserId; item.EmailSearch = false; controller.FlexMLS_Favorites_Add(item); myButton.Text = "SAVED! - " + item.Favorite.ToString(); myButton.ForeColor = System.Drawing.Color.Red; } else { LinkButton myButton = sender as LinkButton; myButton.Text = "Register to Use This Feature"; myButton.ForeColor = System.Drawing.Color.Red; Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "ShowPopup();", true); } //RELOAD LISTING GetListing(MLSnumber); GetSeoValues(); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
// SAVE A SEARCH protected void linkButtonFavorites_Click(object sender, EventArgs e) { try { if (Request.IsAuthenticated) { FlexMLSController controller = new FlexMLSController(); FlexMLSInfo item = new FlexMLSInfo(); item.Favorite = HttpContext.Current.Request.Url.AbsoluteUri.ToString(); item.FavoriteType = "Search"; item.ModuleId = this.ModuleId; item.EmailSearch = true; item.UserID = this.UserId; controller.FlexMLS_Favorites_Add(item); linkButtonFavorites.ForeColor = System.Drawing.Color.Red; linkButtonFavorites.Text = "SEARCH SAVED!"; } else { LinkButton myButton = sender as LinkButton; myButton.Text = "Register to Use This Feature"; myButton.ForeColor = System.Drawing.Color.Red; // Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "ShowPopup();", true); } ////determine if we are adding or updating //if (Null.IsNull(item.ItemId)) // controller.AddFlexMLS(item); //else // controller.UpdateFlexMLS(item); //Response.Redirect(Globals.NavigateURL(), true); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }