Example #1
0
        public void GetListing(int mlsNumber)
        {
            try
            {
                FlexMLSController controller = new FlexMLSController();
                FlexMLSInfo       item       = controller.FlexMLS_Get_Listing(mlsNumber);

                if (item != null)
                {
                    string _S_baths     = "";
                    string _S_halfbaths = "";
                    string _S_beds      = "";

                    string _BedsAndBaths = "";
                    if (item.Bedrooms > 1)
                    {
                        _S_beds = "s";
                    }
                    if (item.TotalBaths > 1)
                    {
                        _S_baths = "s";
                    }
                    if (item.HalfBaths > 1)
                    {
                        _S_halfbaths = "s";
                    }

                    if (item.Bedrooms > 0)
                    {
                        _BedsAndBaths = item.Bedrooms.ToString() + " Bedroom" + _S_beds.ToString();
                    }
                    if (item.FullBaths > 0)
                    {
                        _BedsAndBaths = _BedsAndBaths.ToString() + " - " + item.FullBaths.ToString() + " Full Bath" + _S_baths.ToString();
                    }
                    if (item.HalfBaths > 0)
                    {
                        _BedsAndBaths = _BedsAndBaths.ToString() + " & " + item.HalfBaths.ToString() + " Half Bath" + _S_halfbaths.ToString();
                    }



                    lblMlsInterest.Text = "MLS #: " + item.ListingNumber.ToString() + " | " + String.Format("{0:C0}", item.ListingPrice) + "<br />"
                                          + item.Address.ToString().Trim() + ", " + item.Village.ToString() + "<br />"
                                          + item.PropertyType.ToString() + " | " + _BedsAndBaths.ToString();



                    //if (item.PictureCount > 0)
                    //{
                    //    imgListingImage.ImageUrl = "http://mls.gibs.com/images/" + item.MLNumber.ToString() + ".jpg";
                    //    imgListingImage.Width = 400;

                    //}
                    //else
                    //{
                    //    imgListingImage.Visible = false;
                    //}

                    //if (HttpContext.Current.User.Identity.IsAuthenticated)
                    //{
                    //    lblSummary.Text = lblSummary.Text.ToString() + " | Days on Market: " + item.DOM.ToString();
                    //}

                    //lblSummary.Text
                }
                else
                {
                    //Response.Redirect(Globals.NavigateURL(), true);
                    lblMlsInterest.Text = "Error! Listing cannot be found.";
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Example #2
0
        public void GetListing(int mlsNumber)
        {
            try
            {
                FlexMLSController controller = new FlexMLSController();

                FlexMLSInfo item = controller.FlexMLS_Get_Listing(mlsNumber);

                if (item != null)
                {
                    string _UnitNumber = "";
                    if (item.UnitNumber.ToString().Length >= 1 && item.UnitNumber.ToString() != "0")
                    {
                        _UnitNumber = " " + item.UnitNumber.ToString();
                    }

                    lblListingAddress.Text = item.Address.ToString() + _UnitNumber.ToString() + ", " + item.Village.ToString() + ", " + item.State.ToString() + " " + item.ZipCode.ToString();;
                    lblListingPrice.Text   = String.Format("{0:C0}", item.ListingPrice); //;
                    ListingAddressForGMap  = (lblListingAddress.Text.ToString()).Replace(" ", "%20").ToString();
                    //41.674677,-69.990018

                    _GoogleLatLon = item.Latitude.ToString() + "," + item.Longitude.ToString();

                    //         GetZillowMortgageCalc(Double.Parse(item.ListingPrice.ToString()));

                    ModuleConfiguration.ModuleTitle = "MLS# " + item.ListingNumber.ToString();  // + " - " + lblListingAddress.Text.ToString();

                    // TRENDING LISTINGS
                    if (_addTrendingListing)
                    {
                        string AddListingRecordContent = lblListingAddress.Text.ToString();
                        AddViewListingRecord(Int32.Parse(item.ListingNumber.ToString()), item.ListingPrice, AddListingRecordContent.ToString());
                    }
                    else
                    {
                        // DO NOTHING
                    }

                    // LOOK FOR PRICE REDUCTION
                    if (item.ListingPrice < item.OriginalListPrice)
                    {
                        int    _priceChange    = Int32.Parse(item.OriginalListPrice.ToString()) - Int32.Parse(item.ListingPrice.ToString());
                        string _priceChangeAmt = String.Format("{0:C0}", _priceChange);

                        imgPriceChange.Visible = true;
                        imgPriceChange.ToolTip = _priceChangeAmt.ToString() + " Price Reduction";
                    }
                    else
                    {
                        imgPriceChange.Visible = false;
                    }

                    // LOOK FOR VIRTUAL TOUR
                    if (item.VirtualTourLink.ToString().Trim() != "")
                    {
                        HyperLinkVirtualTourLink.Visible     = true;
                        ImageVirtualTour.Visible             = true;
                        HyperLinkVirtualTourLink.NavigateUrl = item.VirtualTourLink.ToString();
                        HyperLinkVirtualTourLink.ToolTip     = "Virtual Tour for MLS# " + item.ListingNumber.ToString();
                    }
                    else
                    {
                        ImageVirtualTour.Visible         = false;
                        HyperLinkVirtualTourLink.Visible = false;
                    }

                    if (_ZillowAutoRunData == true)
                    {
                        // ZILLOW DATA
                        //     ZillowData.Visible = true;
                        //     GetZillow_zpid(item.Address.ToString() + _UnitNumber.ToString(), item.Village.ToString(), "MA", item.ZipCode.ToString());
                    }
                    else
                    {
                        //    ZillowData.Visible = false;

                        _Z_address = item.Address.ToString() + _UnitNumber.ToString();
                        _Z_city    = item.Village.ToString();
                        _Z_state   = "MA";
                        _Z_zip     = item.ZipCode.ToString();
                    }



                    //HyperLinkInquiry - CONTACT FORM

                    string InquiryLink = Globals.NavigateURL("View", "pg", "Contact", "MLS", item.ListingNumber.ToString());
                    InquiryLink = InquiryLink.ToString().Replace("ctl/View/", "");
                    HyperLinkInquiry.NavigateUrl = InquiryLink.ToString();

                    //HyperLinkShowing - SCHEDULE A SHOWING

                    string ShowingLink = Globals.NavigateURL("View", "pg", "Contact", "MLS", item.ListingNumber.ToString(), "Schedule", "Showing");
                    ShowingLink = ShowingLink.ToString().Replace("ctl/View/", "");
                    HyperLinkShowing.NavigateUrl = ShowingLink.ToString();

                    // linkButtonFavoritesAddListing - ADD TO FAVORITES

                    linkButtonFavoritesAddListing.CommandArgument = item.ListingNumber.ToString();

                    //HyperLinkInquiry - TELL A FRIEND FORM

                    if (Request.IsAuthenticated)
                    {
                        //string TellAFrinedLink = "";

                        HyperLinkTellAFriend.NavigateUrl = Globals.NavigateURL("View", "pg", "TellAFriend", "MLS", item.ListingNumber.ToString()).Replace("ctl/View/", "");
                    }
                    else
                    {
                        HyperLinkTellAFriend.Visible = false;
                    }

                    // GENERAL TABLE

                    if ((item.PropertySubType1.ToString() == "Condominium") || (item.Complex.ToString().Length > 1) || (item.FeeAmount > 0) || (item.MonthlyFeeAmount > 0) || (item.AnnualAssocFee > 0))
                    {
                        PanelCondoSpecific.Visible = true;

                        if (item.Complex.ToString().Length > 1)
                        {
                            AddToTableCondo("Complex Name", item.Complex.ToString());  //CONDO COMPLEX NAME
                        }

                        if (item.MaxNumberOfUnits.ToString().Length > 1)
                        {
                            AddToTableCondo("# of Units", item.MaxNumberOfUnits.ToString());
                        }

                        if (item.MonthlyFeeAmount > 0)
                        {
                            AddToTableCondo("Monthly Fees", String.Format("{0:C0}", item.MonthlyFeeAmount));
                        }

                        if (item.AnnualAssocFee > 0)
                        {
                            AddToTableCondo("Annual Fees", String.Format("{0:C0}", item.AnnualAssocFee));
                        }

                        if (item.FeeAmount > 0)
                        {
                            AddToTableCondo("Fees", String.Format("{0:C0}", item.FeeAmount) + " " + item.FeeFrequency.ToString());
                        }
                        if (item.AssocFeeYear.ToString().Length > 1)
                        {
                            AddToTableCondo("Year", item.AssocFeeYear.ToString());
                        }
                        if (item.Amenities.ToString().Length > 1)
                        {
                            AddToTableCondo("Fee Includes", AddSpaceAfterComma(item.Amenities.ToString()));
                        }
                        if (item.UnitPlacement.ToString().Length > 1)
                        {
                            AddToTableCondo("Unit Placement", AddSpaceAfterComma(item.UnitPlacement.ToString()));
                        }

                        if (item.Restrictions.ToString().Length > 1)
                        {
                            AddToTableCondo("Restrictions", AddSpaceAfterComma(item.Restrictions.ToString()));
                        }
                    }



                    if (item.YearBuilt.ToString().Length > 1)
                    {
                        AddToTableGeneral("Year Built", item.YearBuilt.ToString());
                    }
                    if (item.Style.Length > 1)
                    {
                        AddToTableGeneral("Style", item.Style.ToString());
                    }

                    if (item.LivingSpace.ToString().Length > 1)
                    {
                        AddToTableGeneral("Living Area", String.Format("{0,000}", item.LivingSpace).ToString() + " Sq. Ft.");
                    }

                    if (item.Bedrooms > 0)
                    {
                        AddToTableGeneral("Bedrooms", item.Bedrooms.ToString());
                    }
                    if (item.FullBaths > 0)
                    {
                        AddToTableGeneral("Full Baths", item.FullBaths.ToString());
                    }
                    if (item.HalfBaths > 0)
                    {
                        AddToTableGeneral("Half Baths", item.HalfBaths.ToString());
                    }


                    double lot_sqft = item.Acres;
                    if (lot_sqft > 0)
                    {
                        AddToTableGeneral("Lot Size", Math.Round(lot_sqft, 2).ToString() + " Acres");
                        // lblLotSquareFootage.Text = Math.Round(sqft, 2).ToString() + " Acres";
                    }


                    if (item.Zoning.Length > 1)
                    {
                        AddToTableGeneral("Zoning", item.Zoning.ToString());
                    }


                    if (item.FloodInsuranceRequired.Length > 1)
                    {
                        AddToTableGeneral("Flood Insurance Required", item.FloodInsuranceRequired.ToString());
                    }

                    //[Subdivision]
                    if (item.Subdivision.Length > 1)
                    {
                        AddToTableNeighborhood("Subdivision", AddSpaceAfterComma(item.Subdivision.ToString()));
                    }


                    if (item.WaterfrontYN.Length > 1)
                    {
                        AddToTableGeneral("Waterfront", item.WaterfrontYN.ToString());
                    }

                    if (item.WaterViewYN.Length > 1)
                    {
                        AddToTableGeneral("Water Views", item.WaterViewYN.ToString());
                    }

                    if (item.BeachDescription.Length > 1)
                    {
                        AddToTableGeneral("Beach Description", AddSpaceAfterComma(item.BeachDescription.ToString()));
                    }
                    if (item.BeachLakePond.Length > 1)
                    {
                        AddToTableGeneral("Beach/Lake/Pond Name", item.BeachLakePond.ToString());
                    }
                    if (item.BeachOwnership.Length > 1)
                    {
                        AddToTableGeneral("Beach Ownership", item.BeachOwnership.ToString());
                    }

                    // Neighborhood TABLE
                    if (item.ConvenientTo.Length > 1)
                    {
                        AddToTableNeighborhood("Convenient To", AddSpaceAfterComma(item.ConvenientTo.ToString()));
                    }
                    //NeighborhoodAmenities
                    if (item.NeighborhoodAmenities.Length > 1)
                    {
                        AddToTableNeighborhood("Neighborhood Amenities", AddSpaceAfterComma(item.NeighborhoodAmenities.ToString()));
                    }
                    //SchoolDistrict
                    if (item.SchoolDistrict.Length > 1)
                    {
                        AddToTableNeighborhood("School District", item.SchoolDistrict.ToString());
                    }



                    //lblBedsBaths
                    string _S_baths     = "";
                    string _S_halfbaths = "";
                    string _S_beds      = "";

                    string _BedsAndBaths = "";
                    if (item.Bedrooms > 1)
                    {
                        _S_beds = "s";
                    }
                    if (item.FullBaths > 1)
                    {
                        _S_baths = "s";
                    }
                    if (item.HalfBaths > 1)
                    {
                        _S_halfbaths = "s";
                    }

                    if (item.Bedrooms > 0)
                    {
                        _BedsAndBaths = item.Bedrooms.ToString() + " Bedroom" + _S_beds.ToString();
                    }
                    if (item.FullBaths > 0)
                    {
                        _BedsAndBaths = _BedsAndBaths.ToString() + " - " + item.FullBaths.ToString() + " Full Bath" + _S_baths.ToString();
                    }
                    if (item.HalfBaths > 0)
                    {
                        _BedsAndBaths = _BedsAndBaths.ToString() + " & " + item.HalfBaths.ToString() + " Half Bath" + _S_halfbaths.ToString();
                    }


                    lblSummary.Text = "MLS #: " + item.ListingNumber.ToString() + " | " + item.PropertySubType1.ToString();

                    if (_BedsAndBaths.ToString().Length > 0)
                    {
                        lblSummary.Text = lblSummary.Text.ToString() + " | " + _BedsAndBaths.ToString();
                    }

                    lblMarketingRemarks.Text = item.PublicRemarks.ToString();

                    lblListingOfficeName.Text = item.ListingOfficeName.ToString();



                    // TAX ASSESSMENT TABLE
                    if (item.LandAssessment > 1)
                    {
                        AddToTableTaxAssessment("Land", String.Format("{0:C0}", item.LandAssessment));
                    }
                    if (item.ImprovementAssessment > 1)
                    {
                        AddToTableTaxAssessment("Improvement", String.Format("{0:C0}", item.ImprovementAssessment));
                    }
                    if (item.OtherAssessment > 1)
                    {
                        AddToTableTaxAssessment("Other", String.Format("{0:C0}", item.OtherAssessment));
                    }
                    if (item.TotalAssessments > 1)
                    {
                        AddToTableTaxAssessment("Total Assessments", String.Format("{0:C0}", item.TotalAssessments));
                    }

                    //if (item.TaxYear.Length > 1)
                    //{
                    //    AddToTableTaxAssessment("Tax Year", item.TaxYear.ToString());
                    //}

                    if (item.Taxes > 0)
                    {
                        AddToTableTaxAssessment(item.TaxYear.ToString() + " Taxes", String.Format("{0:C0}", item.Taxes));
                    }

                    //  item.TaxRate


                    if (item.PropertySubType1.ToString() == "Single Family Residence" || item.PropertySubType1.ToString() == "Condominium")
                    {
                        if (item.InteriorFeatures.Length > 1)
                        {
                            AddToTableInterior("Interior Features", AddSpaceAfterComma(item.InteriorFeatures.ToString()));
                        }



                        if (item.KitchenFeatures.Length > 1)
                        {
                            AddToTableInterior("Kitchen Features", AddSpaceAfterComma(item.KitchenFeatures.ToString()));
                        }
                        // INTERIOR FEATURES TABLE
                        if (item.Appliances.Length > 1)
                        {
                            AddToTableInterior("Appliances", AddSpaceAfterComma(item.Appliances.ToString()));
                        }
                        if (item.FamilyRoomFeatures.Length > 1)
                        {
                            AddToTableInterior("Family Room", AddSpaceAfterComma(item.FamilyRoomFeatures.ToString()));
                        }

                        //if (item.MasterBedroom.Length > 5)
                        //{
                        //    AddToTableInterior("Master Bedroom", item.MasterBedroom.ToString().Replace("0x0 ", ""));
                        //}
                        //MasterBedroomFeatures
                        if (item.MasterBedroomFeatures.Length > 1)
                        {
                            AddToTableInterior("Master Bedroom Features", AddSpaceAfterComma(item.MasterBedroomFeatures.ToString()));
                        }

                        if (item.Bedroom2Features.Length > 1)
                        {
                            AddToTableInterior("Bedroom 2 Features", item.Bedroom2Features.ToString());
                        }

                        if (item.Heating.Length > 1)
                        {
                            AddToTableInterior("Heating", item.Heating.ToString());
                        }
                        if (item.FuelType.Length > 1)
                        {
                            AddToTableInterior("Fuel Type", AddSpaceAfterComma(item.FuelType.ToString()));
                        }
                        if (item.Cooling.Length > 1)
                        {
                            AddToTableInterior("Cooling", item.Cooling.ToString());
                        }

                        if (item.HotWater.Length > 1)
                        {
                            AddToTableInterior("Hot Water", item.HotWater.ToString());
                        }

                        if (item.AsbestosYN.Length > 1)
                        {
                            AddToTableInterior("Asbestos", item.AsbestosYN.ToString());
                        }

                        if (item.LeadPaint.Length > 1)
                        {
                            AddToTableInterior("Lead Paint", item.LeadPaint.ToString());
                        }

                        // EXTERIOR FEATURES TABLE
                        if (item.ExteriorFeatures.Length > 1)
                        {
                            AddToTableExterior("Exterior Features", AddSpaceAfterComma(item.ExteriorFeatures.ToString()));
                        }
                        if (item.Foundation.Length > 1)
                        {
                            AddToTableExterior("Foundation", AddSpaceAfterComma(item.Foundation.ToString()));
                        }
                        //Roofing
                        if (item.Roofing.Length > 1)
                        {
                            AddToTableExterior("Roofing", AddSpaceAfterComma(item.Roofing.ToString()));
                        }


                        PanelResiInteriorFeatures.Visible = true;
                    }



                    if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                        lblSummary.Text += " | Days on Market: " + item.DOM.ToString();
                        if (item.OriginalListPrice > 0)
                        {
                            lblSummary.Text += " | Original List Price: " + String.Format("{0:C0}", Convert.ToDouble(item.OriginalListPrice.ToString()));
                        }
                    }
                    else
                    {
                        lblSummary.Text = lblSummary.Text.ToString();
                    }

                    //lblSummary.Text


                    //          BuildGoogleMap(item.Latitude, item.Longitude);
                    BuildPictureGallery(item.PictureCount, item.ListingNumber.ToString());
                }
                else
                {
                    Response.Redirect(Globals.NavigateURL("", "Error=Listing+Removed"), true);
                    lblListingAddress.Text = "Error! Listing cannot be found.";
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }