Пример #1
0
        protected void linkButtonRemoveListing_Click(object sender, EventArgs e)
        {
            try
            {
                int        MLSnumber = 0;
                LinkButton myButton  = sender as LinkButton;

                if (myButton != null)
                {
                    MLSnumber = Convert.ToInt32(myButton.CommandArgument);
                    //myButton.CommandName.ToString()
                }

                FlexMLS_FavoritesController controller = new FlexMLS_FavoritesController();



                // ModuleID is no longer used by this procedure
                controller.FlexMLS_Favorites_Delete_By_MlsNumber(0, this.UserId, MLSnumber.ToString());

                LoadFavListings();
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #2
0
        protected void cbxComplete_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                int      selRowIndex = ((GridViewRow)(((CheckBox)sender).Parent.Parent)).RowIndex;
                CheckBox cb          = (CheckBox)GridView1.Rows[selRowIndex].FindControl("cbxEmailSearch");

                //int itemid = Convert.ToInt32(GridView1.Rows[selRowIndex].Cells[0].Text.ToString());
                int itemid = Convert.ToInt32(GridView1.DataKeys[selRowIndex].Value.ToString());

                FlexMLS_FavoritesInfo       item       = new FlexMLS_FavoritesInfo();
                FlexMLS_FavoritesController controller = new FlexMLS_FavoritesController();

                if (cb.Checked)
                {
                    item.EmailSearch = true;
                }
                else
                {
                    item.EmailSearch = false;
                }

                item.ItemId = itemid;

                controller.FlexMLS_Favorites_Update_EmailSearch(item);

                //lblMessage.Text = selRowIndex.ToString() + " is the row selected and ItemID = " + itemid.ToString();
                lblMessage.Text = "Your selection has been updated!";
                LoadGrid();
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #3
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Delete")
                {
                    int ID = Convert.ToInt32(e.CommandArgument);


                    FlexMLS_FavoritesController controller = new FlexMLS_FavoritesController();
                    controller.FlexMLS_Favorites_Delete(ID);

                    LoadGrid();
                }

                if (e.CommandName == "Edit")
                {
                    int ID = Convert.ToInt32(e.CommandArgument);

                    //   FillIncomeExpenseEdit(ieID);
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #4
0
        public void CountRecords()
        {
            try
            {
                List <FlexMLS_FavoritesInfo> items;
                List <FlexMLS_FavoritesInfo> items1;
                FlexMLS_FavoritesController  controller = new FlexMLS_FavoritesController();

                //  FlexMLS_FavoritesSettings settingsData = new FlexMLS_FavoritesSettings(this.TabModuleId);
                if (Settings["FlexMLSModule"] != null)
                {
                    //SEARCHES
                    items = controller.FlexMLS_Favorites_Get_List(Convert.ToInt32(Settings["FlexMLSModule"].ToString()), this.UserId, "Search");
                    hyperlinkFavSearches.Text = "Saved Searches (" + items.Count.ToString() + ")";

                    //LISTINGS
                    items1 = controller.FlexMLS_Favorites_Get_List(Convert.ToInt32(Settings["FlexMLSModule"].ToString()), this.UserId, "Listing");
                    hyperlinkFavListings.Text = "Saved Listings (" + items1.Count.ToString() + ")";
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #5
0
        public void LoadFavListings()
        {
            try
            {
                List <FlexMLS_FavoritesInfo> items;
                FlexMLS_FavoritesController  controller = new FlexMLS_FavoritesController();

                //  FlexMLS_FavoritesSettings settingsData = new FlexMLS_FavoritesSettings(this.TabModuleId);
                if (_FlexMLSModulePage != "-1")
                {
                    // NO LONGER USING MODULEID - Convert.ToInt32(settingsData.FlexMLSModule)
                    items = controller.FlexMLS_Favorites_Get_List(0, this.UserId, "Listing");

                    if (items.Count > 0)
                    {
                        string MlNumbers = "";
                        for (int i = 0; i < items.Count; i++)
                        {
                            MlNumbers += (string)items[i].Favorite.ToString() + ",";
                            //  list.Add(new ListItem((string)items[i].Village.ToString(), (string)items[i].Village.ToString()));
                        }

                        //     lblDebug.Text = MlNumbers.ToString();
                        SearchMLS(MlNumbers.ToString());
                    }
                    else
                    {
                        //GMap1.Visible = false;
                        lblErrorMessage.Text     = Localization.GetString("DefaultContent", LocalResourceFile);
                        lstSearchResults.Visible = false;
                    }


                    //           hyperlinkFavListings.Visible = true;
                    string vPage = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "FavListing", "mid=" + ModuleId.ToString());
                    //          hyperlinkFavListings.NavigateUrl = vPage.ToString();


                    int              intModTabID    = -1;
                    ModuleInfo       objModuleInfo  = new ModuleInfo();
                    ModuleController objModuleContr = new ModuleController();
                    objModuleInfo = objModuleContr.GetModuleByDefinition(PortalId, "GIBS - FlexMLS");
                    intModTabID   = objModuleInfo.TabID;

                    string strRedir = Globals.NavigateURL(intModTabID);

                    //   string vLink = Globals.NavigateURL(Int32.Parse(settingsData.FlexMLSModule.ToString()),false);
                    HyperLinkNewSearch.NavigateUrl = strRedir.ToString();
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #6
0
        public void LoadGrid()
        {
            try
            {
                List <FlexMLS_FavoritesInfo> items;
                FlexMLS_FavoritesController  controller = new FlexMLS_FavoritesController();


                // FlexMLS_FavoritesSettings settingsData = new FlexMLS_FavoritesSettings(this.TabModuleId);
                if (Settings["FlexMLSModule"] != null)
                {
                    items = controller.FlexMLS_Favorites_Get_List(Convert.ToInt32(Settings["FlexMLSModule"].ToString()), this.UserId, "Search");

                    //if (items.Count == 0)
                    //{
                    //    FlexMLS_FavoritesInfo item = new FlexMLS_FavoritesInfo();
                    //    item.ModuleId = this.ModuleId;
                    //    item.CreatedByUser = this.UserId;
                    //    item.Favorite = Localization.GetString("DefaultContent", LocalResourceFile);

                    //    items.Add(item);
                    //}
                    if (items.Count > 0)
                    {
                        //bind the data
                        GridView1.Visible    = true;
                        GridView1.DataSource = items;
                        GridView1.DataBind();
                        lblDailyEmails.Visible = true;
                    }
                    else
                    {
                        lblErrorMessage.Text   = Localization.GetString("DefaultContent", LocalResourceFile);
                        lblDailyEmails.Visible = false;
                        GridView1.Visible      = false;
                    }
                }
                else
                {
                    lblMessage.Text = "Please configure the module settings.";
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }