Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < 7; i++)
     {
         countrylist[i] = AjaxProvider.getCountryInfoSet(regionid[i]);
     }
 }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        NameValueCollection nvc = Request.Form;

        // string userName, password;
        if (!string.IsNullOrEmpty(Request["resp_number"]))
        {
            respid        = Convert.ToInt32(Request["resp_number"]);
            resp_id.Value = respid.ToString();
        }
        else if (resp_id.Value != null && resp_id.Value != "")
        {
            respid = Convert.ToInt32(resp_id.Value);
        }
        else
        {
            Response.Redirect("/Error.aspx?error=Wrong Request for booking");
        };                                                                        //Not post or Wrong respid
        //Get the inquiry info.
        email_resp = BookResponseEmail.getResponseInfo(respid);
        if (email_resp.ID == 0)
        {
            Response.Redirect("/Error.aspx?error=Wrong Response number or not valid");
        }

        inquiryinfo = BookDBProvider.getQuoteInfo(email_resp.QuoteID);
        owner_info  = BookDBProvider.getUserInfo(inquiryinfo.PropertyOwnerID);
        prop_info   = AjaxProvider.getPropertyDetailInfo(inquiryinfo.PropertyID);
        // _total_sum = email_resp.NightRate * inquiryinfo.Nights;
        _total_sum  = email_resp.NightRate;
        _lodgingval = _total_sum * email_resp.LoadingTax / 100;
        _balance    = _lodgingval + email_resp.CleaningFee + email_resp.SecurityDeposit;
        _total      = _total_sum + _balance;
    }
Esempio n. 3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        prop_category      = BookDBProvider.getDataSet("uspGetPropertyCategory", new List <SqlParameter>());
        all_amenities      = BookDBProvider.getDataSet("uspGetAllAmenity", new List <SqlParameter>());
        allfurnitures      = BookDBProvider.getDataSet("uspGetAllFurniture", new List <SqlParameter>());
        json_allfurnitures = CommonProvider.getJsonStringFromDs(allfurnitures);
        allattractions     = BookDBProvider.getDataSet("uspGetAllAttraction", new List <SqlParameter>());

        //For new property
        if (propertyid == -1)
        {
        }
        else if (propertyid > 0)
        {
            //For the existed property
            propinfo = AjaxProvider.getPropertyDetailInfo(propertyid);
            List <SqlParameter> param = new List <SqlParameter>();
            param.Add(new SqlParameter("@propid", propertyid));
            prop_amenities = BookDBProvider.getDataSet("uspGetPropertyAmenity", param);
            json_amenity   = CommonProvider.getJsonStringFromDs(prop_amenities);
            json_propinfo  = new JavaScriptSerializer().Serialize(propinfo);
            param.Clear();
            param.Add(new SqlParameter("@propid", propertyid));
            json_roomfurnitures = CommonProvider.getJsonStringFromDs(BookDBProvider.getDataSet("uspGetRoomFurnitures", param));
            param.Clear();
            param.Add(new SqlParameter("@propid", propertyid));
            json_attractions = CommonProvider.getJsonStringFromDs(BookDBProvider.getDataSet("uspGetPropertyAttractionByID", param));
        }
    }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Num_list = AjaxProvider.getNumbersProperty();
     using (StreamWriter file = new StreamWriter(Server.MapPath("statisticsNumPro.txt"))) {
         file.WriteLine(String.Format("{0,-20}{1,-40}{2,-20}", "Region", "Country", "# of Properties"));
         foreach (NumbersPropertybyCountry prop in Num_list)
         {
             file.WriteLine(String.Format("{0,-20}{1,-40}{2,-20}", prop.Region, prop.Country, prop.NumProCountry));
         }
     }
 }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * if (!AuthenticationManager.IfAuthenticated || !User.Identity.IsAuthenticated)
         * {
         *  FormsAuthentication.SignOut();
         * }
         */
        string param = AjaxProvider.Base64Decode(Request.QueryString["respid"]);

        if (!Int32.TryParse(param, out respid))
        {
            respid = 0;
        }
        // if (respid == 0) respid = Convert.ToInt32(resp_number.Value);

        email_resp = BookResponseEmail.getResponseInfo(respid);
        if (email_resp.ID == 0)
        {
            Response.Redirect("/Error.aspx?error=Wrong Response number or not valid");
        }

        // resp_number.Value = respid.ToString();

        inquiryinfo = BookDBProvider.getQuoteInfo(email_resp.QuoteID);

        countryinfo = BookDBProvider.getCountryInfo(inquiryinfo.PropertyID);

        //  _total_sum = email_resp.NightRate * inquiryinfo.Nights;
        _total_sum  = email_resp.NightRate;
        _lodgingval = _total_sum * email_resp.LoadingTax / 100;
        _balance    = _lodgingval + email_resp.CleaningFee + email_resp.SecurityDeposit;
        _total      = _total_sum + _balance;

        url = String.Format("https://www.vacations-abroad.com/{0}/{1}/{2}/{3}/default.aspx", countryinfo.country, countryinfo.state, countryinfo.city, inquiryinfo.PropertyID);
    }
Esempio n. 6
0
    //protected SqlDataAdapter CitiesAdapter;

    protected void Page_Load(object sender, System.EventArgs e)
    {
        SqlConnection con = CommonFunctions.GetConnection();

        CitiesAdapter = new SqlDataAdapter(STR_SELECTCitiesFROMCitiesWHERECitiesStateProvinceID, con);//CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), String.Format(STR_SELECTCitiesFROMCitiesWHERECitiesStateProvinceID), SqlDbType.Int);


        DataTable dt = new DataTable();

        CitiesAdapter.Fill(dt);
        List <Location> eList   = new List <Location>();
        string          maxLat  = "";
        string          maxLong = "";

        foreach (DataRow dr in dt.Rows)
        {
            try
            {
                Location e1 = new Location();
                e1.title       = dr["City"].ToString();
                e1.lat         = Convert.ToDouble(dr["Latitude"]);
                e1.lng         = Convert.ToDouble(dr["Longitude"]);;
                e1.description = dr["City"].ToString();
                string temps = CommonFunctions.GetSiteAddress() + "/" + dr["Country"].ToString().ToLower().Replace(" ", "_") +
                               "/" + dr["StateProvince"].ToString().ToLower().Replace(" ", "_") + "/" + dr["City"].ToString().ToLower().Replace(" ", "_") + "/default.aspx";
                e1.URL = temps;
                eList.Add(e1);
            }
            catch { }
        }
        // Response.Write(CitiesAdapter.SelectCommand.CommandText);
        string ans = JsonConvert.SerializeObject(eList, Formatting.Indented);



        ClientScriptManager cs = Page.ClientScript;

        cs.RegisterStartupScript(Page.GetType(), "JSON", "function InitMap(){console.log('exec init');initialize(" + ans + ");}", true);


        //footerPropDescContainer.Visible = false;

        //string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;


        //CommonFunctions.Connection.ConnectionString = connectionstring;

        //if (CommonFunctions.Connection.State == System.Data.ConnectionState.Closed)
        //CommonFunctions.Connection.Open ();

        //lock (CommonFunctions.Connection)
        PropertiesAdapter.Fill(PropertiesFullSet);

        //lock (CommonFunctions.Connection)
        RegionsAdapter.Fill(RegionsSet);
        //lock (CommonFunctions.Connection)
        CountriesAdapter.Fill(CountriesSet);
        //lock (CommonFunctions.Connection)
        StateProvincesAdapter.Fill(StateProvincesSet);
        //lock (CommonFunctions.Connection)
        CitiesAdapter.Fill(CitiesSet);

        //lock (CommonFunctions.Connection)
        AmenitiesAdapter.Fill(AmenitiesSet);
        //lock (CommonFunctions.Connection)
        AttractionsAdapter.Fill(AttractionsSet);

        //if (Master.FindControl ("BodyTag") is HtmlGenericControl)
        //{
        //    HtmlGenericControl body = (HtmlGenericControl)Master.FindControl ("BodyTag");
        //    body.Attributes["onload"] = "InitializeDropdowns ();";
        //}

        string temp = "Vacation rentals at ";

        foreach (DataRow datarow in RegionsSet.Tables["Regions"].Rows)
        {
            if (datarow["Region"] is string)
            {
                regions += " " + (string)datarow["Region"] + ",";
            }
        }

        regions = regions.Substring(0, regions.Length - 1);

        HtmlHead head = Page.Header;
        //Page.ClientScript.RegisterClientScriptInclude("aKeyToIdentifyIt", "/scripts/countryStateCity.js");
        HtmlMeta keywords = new HtmlMeta();

        keywords.Name = "keywords";
        if (PropertiesFullSet.Tables["Properties"].Rows.Count < 1)
        {
            keywords.Content = "View property";
        }
        else
        {
            keywords.Content = Keywords.Text.Replace("%regions%", regions.Trim());
        }

        head.Controls.Add(keywords);
        HtmlMeta description = new HtmlMeta();

        string  meta_str = "";
        DataSet dss      = AjaxProvider.getProNumsbyRegion();

        for (int i = 0; i < dss.Tables[0].Rows.Count; i++)
        {
            meta_str += String.Format("{1} {0} properties, ", dss.Tables[0].Rows[i][0], dss.Tables[0].Rows[i][1]);
        }

        meta_str = meta_str.Substring(0, meta_str.Length - 2);

        description.Name = "description";
        if (PropertiesFullSet.Tables["Properties"].Rows.Count < 1)
        {
            description.Content = "View property";
        }
        else
        {
            description.Content = Description.Text.Replace("%regions%", meta_str.Trim());
        }

        head.Controls.Add(description);

        if (!IsPostBack)
        {
            DataBind();
            // Page.Header.Controls.Add(new LiteralControl("<link href='http://vacations-abroad.com/css/StyleSheet.css' rel='stylesheet' type='text/css' />"));
        }
        DataSet ds = Utility.dsGrab("RegionTextList");

        //ltlAsia.Text = ds.Tables[0].Rows[1]["RegionTextValue"].ToString();
        //ltlEurope.Text = ds.Tables[0].Rows[2]["RegionTextValue"].ToString();
        //ltlNorthAmerica.Text = ds.Tables[0].Rows[3]["RegionTextValue"].ToString();
        //ltlSouthAmerica.Text = ds.Tables[0].Rows[4]["RegionTextValue"].ToString();
        //ltlOceania.Text = ds.Tables[0].Rows[5]["RegionTextValue"].ToString();
        //ltlAsiaList.Text = GenerateCountryLinks("2");
        //ltlOceaniaList.Text = GenerateCountryLinks("3");
        //ltlSouthAmericaList.Text = GenerateCountryLinks("9");
        //ltlEuropeList.Text = GenerateCountryLinks("6");
        //ltlNorthAmericaList.Text = GenerateCountryLinks("8");
    }
Esempio n. 7
0
    protected void SendQuote_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        if (rates.Value == "")
        {
            return;
        }
        decimal _rates, _cleanfee, _secfee, _lodgingtax, _cancel90, _cancel60, _cancel30, _total_sum, _lodgingvalue, _balance;
        int     _validnumber;

        if (!Decimal.TryParse(rates.Value, out _rates))
        {
            _rates = 0;
        }
        if (!Decimal.TryParse(cleaningfee.Value, out _cleanfee))
        {
            _cleanfee = 0;
        }
        if (!Decimal.TryParse(secdeposit.Value, out _secfee))
        {
            _secfee = 0;
        }
        if (!Decimal.TryParse(loadingtax.Value, out _lodgingtax))
        {
            _lodgingtax = 0;
        }
        if (!Decimal.TryParse(cancel90.Value, out _cancel90))
        {
            _cancel90 = 0;
        }
        if (!Decimal.TryParse(cancel60.Value, out _cancel60))
        {
            _cancel60 = 0;
        }
        if (!Decimal.TryParse(cancel30.Value, out _cancel30))
        {
            _cancel30 = 0;
        }
        if (!Int32.TryParse(validnumber.Value, out _validnumber))
        {
            _validnumber = 0;
        }

        //_total_sum = _rates * inquiryinfo.Nights;
        _total_sum    = _rates;
        _lodgingvalue = _total_sum * _lodgingtax / 100;
        _balance      = _lodgingvalue + _secfee + _cleanfee;

        int newrespid = 0;
        int _currency = Convert.ToInt32(currency.SelectedValue);

        if ((newrespid = BookDBProvider.addEmailResponse(inquiryinfo.PropertyOwnerID, inquiryinfo.UserID, quoteid, _rates, _cleanfee, _secfee, _lodgingtax, _cancel30, _cancel60, _cancel90, DateTime.Now, _validnumber, _currency, comment.InnerText)) > 0)
        {
            BookDBProvider.updateEmailQuoteState(quoteid);
        }



        UserInfo userinfo = BookDBProvider.getUserInfo(inquiryinfo.PropertyOwnerID);
        //  BookResponseEmail  /for owner
        string toOwner = String.Format("Hi, {0}!<br> You have replied the inquiry for the property {1} in {2},{3},{4}.<br> Thanks.",
                                       userinfo.firstname + " " + userinfo.lastname, inquiryinfo.PropertyID, countryinfo.city, countryinfo.state, countryinfo.country);

        BookDBProvider.SendEmail(userinfo.email, "You have replied for the inquiry", toOwner);

        PropertyDetailInfo propinfo = AjaxProvider.getPropertyDetailInfo(inquiryinfo.PropertyID);
        string             url      = String.Format("https://www.vacations-abroad.com/{0}/{1}/{2}/{3}/default.aspx", propinfo.Country, propinfo.StateProvince, propinfo.City, propinfo.ID).ToLower().Replace(" ", "_");

        //To traveler
        // UserInfo traveler = BookDBProvider.getUserInfo(inquiryinfo.UserID);
        string  toTraveler = @"<body>
  {22}
  <table border='0px' width='600px' >
    <tr>
      <td>
         <table  style='width:600px;'>
            <tr>
              <td style='color:#000;font-size:16pt;width:300px;font-family: Verdana;'>
                <b>Vacations Abroad</b>
              </td>
              <td style='color:#000;font-size:10pt;width:300px;text-align: right;font-family: Verdana;'>
                {0}
              </td>
            </tr>
         </table>
      </td>
    </tr>
    <tr>
      <td bgcolor='#4472c4' style='border:1px solid #2f528f;text-align:center;padding: 10px 0px;color:#fff;font-size:12pt;font-family: Verdana;'>
            <a href='https://www.vacations-abroad.com/quoteresponse.aspx?respid={21}' style='cursor: pointer;color: #fff;text-decoration: none;font-size:12pt;font-family: Verdana;'>
                <b>Book Now!<b>
            </a>
      </td>
    </tr>
    <tr>
      <td style='text-align: center;padding: 10px 0px;'>
        <img src='{2}' style='width:350px;height: 220px;'  width='350' height='220' />
      </td>
    </tr>
    <tr>
        <td style='text-align: center;font-size:10pt;font-family: Verdana;'>
           Name of property:{3} &nbsp;&nbsp; Type of property:{4}
        </td>
    </tr>
    <tr>
      <td style='padding: 10px;'>
        <table style='border:1px dashed #000;width:600px;font-size:12pt;'>
            <tr>
                <td style='padding:10px;font-family: Verdana;'>
              <a href='{5}'>Property {6}</a> <br/>
              Date of Arrival: {7} <br/>
              {8} of nights <br/>
              # of Guests:  {9} Adults, {10} children <br/><br/>
             
                  Total Amount Due:{12} {19}<br/>
                  Amount Due to Reserve:{13} {19} <br/>

              
                </td>
            </tr>
            <tr>
            <td style='background: none; border: dotted 1px #999999; border-width:1px 0 0 0; height:1px;font-size:1px;'></td>
            </tr>
            <tr>
                <td style='padding:3px;font-family: Verdana;'>
                  Cleaning Fee:{15} {19}<br/>
                  Security Deposit:{16} {19}<br/>
                  Lodging Tax:{17}% {20}{19}<br/>
                  Amount Due Upon Arrival:{18}  <br/>
                  Comment:{23}<br/>
                </td>            
            </tr>
          </table>
      </td>
    </tr>
    <tr>
     <td style='padding: 15px; text-align: center;'>
        <a href='https://www.vacations-abroad.com/quoteresponse.aspx?respid={21}' style='padding:3px 20px;border:1px solid #000;cursor: pointer;color: #f86308;text-decoration: none;font-size:12pt;font-family: Verdana;'>
	      <b>Book Now</b>
	    </a> 
     </td>
    </tr>
    <tr>
      <td style='text-align: center;'>
        <img src='https://www.vacations-abroad.com/images/elogo.jpg' style='width:240px;height: 100px;' width='240' height='100' />     
      </td>
    </tr>
  </table>
</body>";
        decimal _total     = _total_sum + _balance;
        string  msg        = String.Format(toTraveler, DateTime.Now.ToString("MMM d, yyyy"), inquiryinfo.ContactorName, "https://www.vacations-abroad.com/images/" + propinfo.FileName, propinfo.Name2, propinfo.CategoryTypes, url, propinfo.ID, inquiryinfo.ArrivalDate, inquiryinfo.Nights, inquiryinfo.Adults, inquiryinfo.Children, userinfo.name, BookDBProvider.DoFormat(_total), BookDBProvider.DoFormat(_total_sum), BookDBProvider.DoFormat(_rates), BookDBProvider.DoFormat(_cleanfee), BookDBProvider.DoFormat(_secfee), _lodgingtax, BookDBProvider.DoFormat(_balance), currency.SelectedItem.Text, BookDBProvider.DoFormat(_lodgingvalue), AjaxProvider.Base64Encode(newrespid.ToString()), "<style>a:hover{color:#8bbdeb;} </style>", comment.InnerText);

        //BookDBProvider.SendEmail(traveler.email, toTraveler, "You have received the response from the property owner");
        BookDBProvider.SendEmail(inquiryinfo.ContactorEmail, String.Format("{0}, here is your quote for {1}", inquiryinfo.ContactorName, inquiryinfo.ArrivalDate), msg);
        BookDBProvider.SendEmail("*****@*****.**", String.Format("{0} has responded to {1}", userinfo.name, inquiryinfo.ContactorName), msg);

        if (AuthenticationManager.IfAdmin)
        {
            Response.Redirect("/userowner/listings.aspx?userid=" + inquiryinfo.PropertyOwnerID);
        }
        else
        {
            Response.Redirect("/userowner/listings.aspx");
        }
    }
Esempio n. 8
0
    protected void sendcomments_Click(object sender, EventArgs e)
    {
        string comments = Request["comments"];

        //  Response.Write(comments);
        if (comments == "")
        {
            return;
        }

        int newrespid = 0;
        int _currency = Convert.ToInt32(currency.SelectedValue);

        if ((newrespid = BookDBProvider.addEmailResponse(inquiryinfo.PropertyOwnerID, inquiryinfo.UserID, quoteid, 0, 0, 0, 0, 0, 0, 0, DateTime.Now, -1, _currency, comments)) > 0)
        {
            BookDBProvider.updateEmailQuoteState(quoteid);
        }



        UserInfo userinfo = BookDBProvider.getUserInfo(inquiryinfo.PropertyOwnerID);
        //  BookResponseEmail  /for owner
        string toOwner = String.Format("Hi, {0}!<br> You have replied the inquiry for the property {1} in {2},{3},{4}.<br> Thanks.",
                                       userinfo.firstname + " " + userinfo.lastname, inquiryinfo.PropertyID, countryinfo.city, countryinfo.state, countryinfo.country);

        BookDBProvider.SendEmail(userinfo.email, "You have replied for the inquiry", toOwner);

        PropertyDetailInfo propinfo = AjaxProvider.getPropertyDetailInfo(inquiryinfo.PropertyID);
        string             url      = String.Format("https://www.vacations-abroad.com/{0}/{1}/{2}/{3}/default.aspx", propinfo.Country, propinfo.StateProvince, propinfo.City, propinfo.ID).ToLower().Replace(" ", "_");

        //To traveler
        // UserInfo traveler = BookDBProvider.getUserInfo(inquiryinfo.UserID);
        string toTraveler = @"<body>
  <table border='0px' width='600px' >
    <tr>
      <td>
         <table  style='width:600px;'>
            <tr>
              <td style='color:#000;font-size:16pt;width:300px;font-family: Verdana;'>
                <b>Vacations Abroad</b>
              </td>
              <td style='color:#000;font-size:10pt;width:300px;text-align: right;font-family: Verdana;'>
                {0}
              </td>
            </tr>
         </table>
      </td>
    </tr>
    <tr>
      <td bgcolor='#4472c4' style='border:1px solid #2f528f;text-align:center;padding: 10px 0px;color:#fff;font-size:12pt;font-family: Verdana;'>
            <a style='cursor: pointer;color: #fff;text-decoration: none;font-size:12pt;font-family: Verdana;'>
                <b>Sorry! The property is not available on {6}<b>
            </a>
      </td>
    </tr>
    <tr>
      <td style='text-align: center;padding: 10px 0px;'>
        <img src='{1}' style='width:350px;height: 220px;'  width='350' height='220' />
      </td>
    </tr>
    <tr>
        <td style='text-align: center;font-size:10pt;font-family: Verdana;'>
           Name of property:{2} &nbsp;&nbsp; Type of property:{3}
        </td>
    </tr>
    <tr>
      <td style='padding: 10px;'>
        <table style='border:1px dashed #000;width:600px;font-size:12pt;'>
            <tr>
                <td style='padding:10px;font-family: Verdana;'>
              <a href='{4}'>Property {5}</a> <br/>
              Date of Arrival: {6} <br/>
              {7} of nights <br/>
              # of Guests:  {8} Adults, {9} children <br/><br/>
                
                </td>
            </tr>
            <tr>
            <td style='background: none; border: dotted 1px #999999; border-width:1px 0 0 0; height:1px;font-size:1px;'></td>
            </tr>
            <tr>
                <td style='padding:3px;font-family: Verdana;'>
                  Comment:{10}<br/>
                </td>            
            </tr>
          </table>
      </td>
    </tr>
    <tr>
     <td style='padding: 15px; text-align: center;'>
        <a style='padding:3px 20px;border:1px solid #000;cursor: pointer;color: #f86308;text-decoration: none;font-size:12pt;font-family: Verdana;'>
	      <b>Sorry! The property is not available on {6}</b>
	    </a> 
     </td>
    </tr>
    <tr>
      <td style='text-align: center;'>
        <img src='https://www.vacations-abroad.com/images/elogo.jpg' style='width:240px;height: 100px;' width='240' height='100' />     
      </td>
    </tr>
  </table>
</body>";
        string msg        = String.Format(toTraveler, DateTime.Now.ToString("MMM d, yyyy"), "https://www.vacations-abroad.com/images/" + propinfo.FileName, propinfo.Name2, propinfo.CategoryTypes, url, propinfo.ID, inquiryinfo.ArrivalDate, inquiryinfo.Nights, inquiryinfo.Adults, inquiryinfo.Children, comments);

        //BookDBProvider.SendEmail(traveler.email, toTraveler, "You have received the response from the property owner");
        BookDBProvider.SendEmail(inquiryinfo.ContactorEmail, String.Format("{0}, here is your quote for {1}", inquiryinfo.ContactorName, inquiryinfo.ArrivalDate), msg);
        BookDBProvider.SendEmail("*****@*****.**", String.Format("{0} has responded to {1}", userinfo.name, inquiryinfo.ContactorName), msg);

        if (AuthenticationManager.IfAdmin)
        {
            Response.Redirect("/userowner/listings.aspx?userid=" + inquiryinfo.PropertyOwnerID);
        }
        else
        {
            Response.Redirect("/userowner/listings.aspx");
        }
    }
    public JsonResult processRequest()
    {
        JsonResult jsonresult = new JsonResult();

        if (!AuthenticationManager.IfAuthenticated || !User.Identity.IsAuthenticated)
        {
            jsonresult.error = "Not Signed";
            return(jsonresult);
        }
        else if (HttpContext.Current.Request.HttpMethod != "POST")
        {
            jsonresult.error = "The function works in POST method";
            return(jsonresult);
        }
        //else{}  //If the user is signed

        if (!Int32.TryParse(Request["propid"], out propid))
        {
            propid = -1;
        }

        //Validate parameters from the request
        int wizard_step = -1;

        if (!Int32.TryParse(Request["wizardstep"], out wizard_step))
        {
            wizard_step = -1;
        }
        if (wizard_step == -1)
        {
            jsonresult.error = "Wizard Step is not set.";
            return(jsonresult);
        }
        if (!ValdateWizardStep(wizard_step))  //Valdation for step parameters by step number
        {
            jsonresult.error = "Wizard Step is not set.";
            return(jsonresult);
        }

        if (wizard_step == 0 && (propid == -1 || propid == 0))
        {
            propid = createNewProperty();
            if (propid == -1)
            {
                jsonresult.error = "Server something wrong error: get new property id";
                return(jsonresult);
            }
        }
        else //For the existed property
        {
            if (propid == -1 || propid == 0)
            {
                jsonresult.error = "Server something wrong error: step is not 0, and propid is -1";
                return(jsonresult);
            }
            propinfo = AjaxProvider.getPropertyDetailInfo(propid);
            if (propinfo.UserID != userid && !AuthenticationManager.IfAdmin)
            {
                jsonresult.error = "You are trying to do malicious action. Property doesn't include to you.";
                return(jsonresult);
            }
            if (UpdatePropertyInfo(wizard_step) == -1)
            {
                jsonresult.error = "Server something wrong error: update property info step " + wizard_step;
                return(jsonresult);
            }
        }

        List <SqlParameter> param = new List <SqlParameter>();

        if (propid > 0)
        {
            propinfo            = AjaxProvider.getPropertyDetailInfo(propid); //Get the property id
            jsonresult.propinfo = propinfo;
            if (wizard_step == 1)
            {
                param.Add(new SqlParameter("@propid", propid));
                amenity_list            = MainHelper.getListFromDB <AmenityInfo>("uspGetPropertyAmenity", param);
                jsonresult.amenity_list = amenity_list;
                param.Clear();
                param.Add(new SqlParameter("@propid", propid));
                jsonresult.room_furniture = CommonProvider.getJsonStringFromDs(BookDBProvider.getDataSet("uspGetRoomFurnitures", param));
            }
            else if (wizard_step == 2)
            {
                param.Clear();
                param.Add(new SqlParameter("@propid", propid));
                jsonresult.attractions = CommonProvider.getJsonStringFromDs(BookDBProvider.getDataSet("uspGetPropertyAttractionByID", param));
            }
        }

        jsonresult.propid = propid;
        if (propid == propinfo.ID)
        {
            jsonresult.status = 0;
        }
        return(jsonresult);
    }
Esempio n. 10
0
 public string generateID()
 {
     return(AjaxProvider.Base64Encode(Guid.NewGuid().ToString("N")));
 }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.Request.HttpMethod != "POST")
        {
            Response.Write("Wrong request");
            return;
        }

        context = HttpContext.Current;

        parseTransaction();
        PaymentHelper.addPaymentLog(transitem);

        email_resp = BookResponseEmail.getResponseInfo(transitem.item_number); //respid
                                                                               // if (email_resp.ID == 0 || email_resp.IsValid < 1) Response.Redirect("/Error.aspx?error=Wrong Response number or not valid");

        inquiryinfo = BookDBProvider.getQuoteInfo(email_resp.QuoteID);
        owner_info  = BookDBProvider.getDetailedUserInfo(inquiryinfo.PropertyOwnerID);
        // traveler_info = BookDBProvider.getUserInfo(inquiryinfo.UserID);
        prop_info = AjaxProvider.getPropertyDetailInfo(inquiryinfo.PropertyID);



        ServicePointManager.Expect100Continue = true;
        ServicePointManager.SecurityProtocol  = (SecurityProtocolType)3072;

        //  string requestUriString = "https://www.sandbox.paypal.com/cgi-bin/webscr";
        string requestUriString = "https://www.paypal.com/cgi-bin/webscr";

        HttpWebRequest request =
            (HttpWebRequest)WebRequest.Create(requestUriString);

        string strFormValues = Encoding.ASCII.GetString(
            context.Request.BinaryRead(context.Request.ContentLength));

        // Set values for the request back
        request.Method      = "POST";
        request.ContentType = "application/x-www-form-urlencoded";
        string obj2 = strFormValues + "&cmd=_notify-validate";

        request.ContentLength = obj2.Length;

/*
 *      System.IO.StreamWriter file = new System.IO.StreamWriter(Server.MapPath("/logwrite.txt"));
 *      file.Write(obj2);
 *      file.Close();
 */
        // Write the request back IPN strings
        StreamWriter writer =
            new StreamWriter(request.GetRequestStream(), Encoding.ASCII);

        writer.Write(RuntimeHelpers.GetObjectValue(obj2));
        writer.Close();

        //send the request, read the response
        HttpWebResponse response       = (HttpWebResponse)request.GetResponse();
        Stream          responseStream = response.GetResponseStream();
        Encoding        encoding       = Encoding.GetEncoding("utf-8");
        StreamReader    reader         = new StreamReader(responseStream, encoding);
        string          resp           = reader.ReadToEnd();

        //_total_sum = email_resp.NightRate * inquiryinfo.Nights;
        _total_sum  = email_resp.NightRate;
        _lodgingval = _total_sum * email_resp.LoadingTax / 100;
        _balance    = _lodgingval + email_resp.CleaningFee + email_resp.SecurityDeposit;
        _total      = _total_sum + _balance;

        /*
         * System.IO.StreamWriter sfile = new System.IO.StreamWriter(Server.MapPath("/log.txt"));
         * sfile.Write(resp);
         * sfile.Close();
         */
        int discount;

        if (transitem.custom.Length == 13)
        {
            List <SqlParameter> param = new List <SqlParameter>();
            param.Add(new SqlParameter("@coupon", transitem.custom));

            DataSet ds_coupon = BookDBProvider.getDataSet("uspGetCouponItem", param);
            if (ds_coupon.Tables[0].Rows.Count > 0)
            {
                if (!int.TryParse(ds_coupon.Tables[0].Rows[0]["Discount"].ToString(), out discount))
                {
                    discount = 0;
                }

                _total = _total_sum * (100 - discount) / 100 + _balance;
            }
        }

        _total = Decimal.Parse(BookDBProvider.DoFormat(_total));


        if (resp == "VERIFIED")
        {
            //if(transitem.business == ConfigurationManager.AppSettings["PaypalEmail"].ToString() && transitem.txn_type!= "reversal")

/*            System.IO.StreamWriter ssfile = new System.IO.StreamWriter(Server.MapPath("/logt.txt"));
 *          ssfile.Write(resp);
 *          ssfile.Close();
 */
            // if (transitem.business == "*****@*****.**" && transitem.txn_type != "reversal")
            if (transitem.business == ConfigurationManager.AppSettings["PaypalEmail"].ToString() && transitem.txn_type != "reversal")
            {
                if ((transitem.mc_gross == (_total)) && transitem.payment_status == "Completed" && transitem.mc_currency == currency_type[email_resp.CurrencyType])
                {
                    PaymentHelper.addPaymentHistory(transitem, inquiryinfo);


                    BookResponseEmail.updateEmailResponseState(transitem.item_number);

                    string format_traveler = @"This is your receipt for your reservation with Vacations-Abroad.com <br/>
This email confirms that {0} has booked a reservation with {1}. <br/>
Your Arrival Date is: {2} <br/>
You paid: {3} {4} on {5} <br/>
The owner’s cancellation policy is <br/>
90 days prior to arrival:{6}% <br/>
60 days prior to arrival:{7}% <br/>
30 days prior to arrival:{8}% <br/>

Owner Contact Details <br/>
Owner Name:{9} <br/>
Owner Email:{10} <br/>
Owner Telephone:{11} <br/>
Name of Property:{1} <br/>
Owner Website: {12} <br/>
Please contact the owner to obtain the actual property address. <br/>
If you do not cancel, the funds will be transferred to the owner on (7 days prior to your {13}) <br/>
When you return, please write a review of the property and add photos. <br/>";

                    string msg_traveler = String.Format(format_traveler, inquiryinfo.ContactorName, prop_info.PropertyName, DateTime.Parse(inquiryinfo.ArrivalDate).ToString("MMM d, yyyy"),
                                                        transitem.mc_gross, transitem.mc_currency, DateTime.Now.ToString("MMM d, yyyy"), email_resp.Cancel90, email_resp.Cancel60, email_resp.Cancel30
                                                        , String.Format("{0} {1}", owner_info.FirstName, owner_info.LastName), owner_info.Email,
                                                        owner_info.MobileTelephone, owner_info.Website, DateTime.Parse(inquiryinfo.ArrivalDate).ToString("MMM d, yyyy"));

                    string trv_subject = String.Format("Reservation Confirmation for {0}", DateTime.Now.ToString("MMM d, yyyy"));
                    BookDBProvider.SendEmail(inquiryinfo.ContactorEmail, trv_subject, msg_traveler);

                    string format_owner  = @"This is a confirmation for the reservation completed through Vacations-Abroad.com <br/>
This email confirms that {0} has booked a reservation with {1}. <br/>
Arrival Date is: {2} <br/>
They have paid: {3} {4} on {5} <br/>
The owner’s cancellation policy is <br/>
90 days prior to arrival:{6}% <br/>
60 days prior to arrival:{7}% <br/>
30 days prior to arrival:{8}% <br/><br/>
Traveler Contact Details <br/><br/>
Traveler Name:{9} <br/>
Traveler Email:{10} <br/>
Traveler Telephone:{11} <br/><br/> 
Please contact the traveler to provide them with directions to your property and inform them of any check-in procedures. <br/>
If the Traveler does not cancel, the funds will be transferred to your Paypal or bank account  (7 days prior to your {2}) less a 10% commission fee. If any fees such as cleaning fees, security deposit or lodging taxes are to be collected by you at arrival. <br/>
You have specified these additional fees are due at arrival. <br/>
Cleaning:{12} {4} <br/>
Security Deposit:{13} {4}<br/>
Lodging Tax:{14} {4}<br/><br/>

Let us know if we can be of further assistance. <br/>
Linda Jenkins <br/>
770-687-6889 <br/>";
                    string owner_subject = String.Format("Reservation Confirmation for {0}", DateTime.Now.ToString("MMM d, yyyy"));
                    string msg_owner     = String.Format(format_owner, inquiryinfo.ContactorName, prop_info.PropertyName
                                                         , DateTime.Parse(inquiryinfo.ArrivalDate).ToString("MMM d, yyyy"), transitem.mc_gross, transitem.mc_currency,
                                                         DateTime.Now.ToString("MMM d, yyyy"), email_resp.Cancel90, email_resp.Cancel60, email_resp.Cancel30,
                                                         inquiryinfo.ContactorName, inquiryinfo.ContactorEmail, inquiryinfo.Telephone,
                                                         BookDBProvider.DoFormat(email_resp.CleaningFee), BookDBProvider.DoFormat(email_resp.SecurityDeposit), BookDBProvider.DoFormat(_lodgingval));
                    BookDBProvider.SendEmail(owner_info.Email, owner_subject, msg_owner);
                    BookDBProvider.SendEmail("*****@*****.**", String.Format("{0} has paid for property {1} Transaction:{2}", inquiryinfo.ContactorName, transitem.item_number, transitem.txn_id), msg_owner);
                    BookDBProvider.SendEmail("*****@*****.**", "Notification: Transaction:" + transitem.txn_id, msg_owner);
                }
            }
        }
        else
        {
        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        StateProvincesAdapter = CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), "SELECT StateProvinces.* " +
                                                               "FROM StateProvinces " +
                                                               "WHERE (StateProvinces.CountryID = @CountryID) AND EXISTS (" +
                                                               " SELECT * FROM Properties INNER JOIN Cities ON Properties.CityID = Cities.ID" +
                                                               " WHERE (Properties.IfFinished = 1) AND (Properties.IfApproved = 1)" +
                                                               " AND (Cities.StateProvinceID = StateProvinces.ID) " +
                                                               " AND NOT EXISTS (SELECT * FROM Auctions WHERE PropertyID = Properties.ID)) " +
                                                               "ORDER BY StateProvince", SqlDbType.Int);
        CitiesAdapter = CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), String.Format(STR_SELECTCitiesFROMCitiesWHERECitiesStateProvinceID), SqlDbType.Int);

        const string STR_SELECTPropertiesInfo = "SELECT Properties.Name, Properties.NumBedrooms, Properties.NumBaths, Properties.NumSleeps, Properties.NumTVs, Properties.NumVCRs, Properties.CityID, Properties.NumCDPlayers, Properties.ID, CASE WHEN EXISTS (SELECT * FROM PropertiesAmenities INNER JOIN Amenities ON PropertiesAmenities.AmenityID = Amenities.ID WHERE (PropertiesAmenities.PropertyID = Properties.ID) AND (Amenities.Amenity = 'Beach Front')) THEN 'Beach Front' ELSE '' END AS BeachFront, CASE WHEN EXISTS (SELECT * FROM PropertiesAmenities INNER JOIN Amenities ON PropertiesAmenities.AmenityID = Amenities.ID WHERE (PropertiesAmenities.PropertyID = Properties.ID) AND (Amenities.Amenity = 'Seaside')) THEN 'Seaside' ELSE '' END AS Seaside, CASE WHEN EXISTS (SELECT * FROM PropertiesAmenities INNER JOIN Amenities ON PropertiesAmenities.AmenityID = Amenities.ID WHERE (PropertiesAmenities.PropertyID = Properties.ID) AND (Amenities.Amenity = 'Lake Front')) THEN 'Lake Front' ELSE '' END AS LakeFront, CASE WHEN EXISTS (SELECT * FROM PropertiesAmenities INNER JOIN Amenities ON PropertiesAmenities.AmenityID = Amenities.ID WHERE (PropertiesAmenities.PropertyID = Properties.ID) AND (Amenities.Amenity = 'River Front')) THEN 'River Front' ELSE '' END AS RiverFront, CASE WHEN EXISTS (SELECT * FROM PropertiesAmenities INNER JOIN Amenities ON PropertiesAmenities.AmenityID = Amenities.ID WHERE (PropertiesAmenities.PropertyID = Properties.ID) AND (Amenities.Amenity = 'Ski In Ski Out')) THEN 'Ski In Ski Out' ELSE '' END AS Ski, Cities.City, StateProvinces.StateProvince, Countries.Country, Regions.Region, MinimumNightlyRentalTypes.Name AS MinimumNightlyRental, PropertyTypes.Name AS Type FROM Properties INNER JOIN Cities ON Properties.CityID = Cities.ID INNER JOIN StateProvinces ON StateProvinces.ID = Cities.StateProvinceID INNER JOIN Countries ON StateProvinces.CountryID = Countries.ID INNER JOIN Regions ON Countries.RegionID = Regions.ID INNER JOIN Users ON Properties.UserID = Users.ID LEFT OUTER JOIN MinimumNightlyRentalTypes ON Properties.MinimumNightlyRentalID = MinimumNightlyRentalTypes.ID LEFT OUTER JOIN PropertyTypes ON Properties.TypeID = PropertyTypes.ID WHERE (Properties.IfFinished = 1) AND (Properties.IfApproved = 1) AND (Cities.StateProvinceID = @StateProvinceID) AND NOT EXISTS (SELECT * FROM Auctions WHERE PropertyID = Properties.ID) ORDER BY StateProvinces.StateProvince, Cities.City, Type, CASE WHEN EXISTS (SELECT * FROM Invoices WHERE (PropertyID = Properties.ID) AND (PaymentAmount >= InvoiceAmount) AND (GETDATE() <= Invoices.RenewalDate)) THEN 1 ELSE 0 END DESC, Properties.ID";

        PropertiesAdapter = CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), String.Format(STR_SELECTPropertiesInfo), SqlDbType.Int);

        AmenitiesAdapter = CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), "SELECT Amenities.ID, Amenity," +
                                                          " PropertiesAmenities.PropertyID " +
                                                          "FROM Amenities INNER JOIN PropertiesAmenities ON Amenities.ID = PropertiesAmenities.AmenityID" +
                                                          " INNER JOIN Properties ON PropertiesAmenities.PropertyID = Properties.ID " +
                                                          " INNER JOIN Cities ON Properties.CityID = Cities.ID " +
                                                          "WHERE (Properties.IfFinished = 1) AND (Properties.IfApproved = 1) AND (Cities.StateProvinceID = @StateProvinceID)" +
                                                          " AND NOT EXISTS (SELECT * FROM Auctions WHERE PropertyID = Properties.ID) AND (Amenities.Amenity NOT IN" +
                                                          " ('Lake Front', 'Beach Front', 'River Front', 'Seaside', 'Ski In Ski Out', 'TV', 'VCR', 'CD Player'))",
                                                          SqlDbType.Int);

        LocationAdapter = CommonFunctions.PrepareAdapter(CommonFunctions.GetConnection(), "SELECT StateProvinces.ID AS StateProvinceID," +
                                                         " StateProvinces.StateProvince, Countries.ID AS CountryID, Countries.Country, Regions.ID AS RegionID," +
                                                         " Regions.Region, stateprovinces.titleoverride, stateprovinces.descriptionoverride " +
                                                         "FROM StateProvinces INNER JOIN Countries ON StateProvinces.CountryID = Countries.ID" +
                                                         " INNER JOIN Regions ON Countries.RegionID = Regions.ID WHERE (StateProvinces.ID = @StateProvinceID)",
                                                         SqlDbType.Int);


        if ((Request.Params["StateProvinceID"] != null) && (Request.Params["StateProvinceID"].Length > 0))
        {
            try
            {
                stateprovinceid = Convert.ToInt32(Request.Params["StateProvinceID"]);
            }
            catch (Exception)
            {
            }
        }
        // IF state is not found throw an error
        if (stateprovinceid == -1)
        {
            Response.Redirect(CommonFunctions.PrepareURL("InternalError.aspx"));
        }

        CitiesAdapter.SelectCommand.Parameters["@StateProvinceID"].Value     = stateprovinceid;
        LocationAdapter.SelectCommand.Parameters["@StateProvinceID"].Value   = stateprovinceid;
        PropertiesAdapter.SelectCommand.Parameters["@StateProvinceID"].Value = stateprovinceid;
        AmenitiesAdapter.SelectCommand.Parameters["@StateProvinceID"].Value  = stateprovinceid;
        if (LocationAdapter.Fill(MainDataSet, "Location") > 0)
        {
            regionid      = (int)MainDataSet.Tables["Location"].Rows[0]["RegionID"];
            countryid     = (int)MainDataSet.Tables["Location"].Rows[0]["CountryID"];
            region        = (string)MainDataSet.Tables["Location"].Rows[0]["Region"];
            country       = (string)MainDataSet.Tables["Location"].Rows[0]["Country"];
            stateprovince = (string)MainDataSet.Tables["Location"].Rows[0]["StateProvince"];
        }
        else
        {
            Response.Redirect(CommonFunctions.PrepareURL("InternalError.aspx"));
        }

        StateProvincesAdapter.SelectCommand.Parameters["@CountryID"].Value = countryid;
        CitiesAdapter.Fill(MainDataSet, "Cities");
        PropertiesAdapter.Fill(MainDataSet, "Properties");
        AmenitiesAdapter.Fill(MainDataSet, "Amenities");
        StateProvincesAdapter.Fill(MainDataSet, "StateProvinces");
        DBConnection objTemp = new DBConnection();
        DataTable    dtTemp  = new DataTable();

        try
        {
            dtTemp = VADBCommander.CountyNamesWithProperties(Request.Params["StateProvinceID"].ToString());
            DataTable dtCopy = dtTemp.Copy();
            dtCopy.TableName = "dtcopy";
            dtCopy.Namespace = "dtcopy";
            MainDataSet.Tables.Add(dtCopy);
            MainDataSet.Relations.Add("CitiesProperties", MainDataSet.Tables["Cities"].Columns["ID"],
                                      MainDataSet.Tables["Properties"].Columns["CityID"]);
            MainDataSet.Relations.Add("PropertiesAmenities", MainDataSet.Tables["Properties"].Columns["ID"],
                                      MainDataSet.Tables["Amenities"].Columns["PropertyID"]);

            MainDataSet.Relations.Add("CountyCities", MainDataSet.Tables["dtcopy"].Columns["ID"],
                                      MainDataSet.Tables["Cities"].Columns["countyID"]);
            LocationAdapterCountry.SelectCommand.Parameters["@CountryID"].Value = countryid;
        }
        catch (Exception ex) { lblInfo22.Text += ex.Message; }
        finally { objTemp.CloseConnection(); }

        foreach (DataRow datarow in MainDataSet.Tables["Cities"].Rows)
        {
            if (datarow["City"] is string)
            {
                cities += " " + (string)datarow["City"];
            }
        }

        HtmlHead head = Page.Header;



        DataBind();

        /////// common for postback and ! postback
        List <string> vList        = new List <string>();
        DataTable     dt           = new DataTable();
        DataFunctions obj          = new DataFunctions();
        DataTable     dtCategories = new DataTable();
        DBConnection  obj1         = new DBConnection();

        try
        {
            Page page = (Page)HttpContext.Current.Handler;
            if (!IsPostBack)
            {
                dt = obj.PropertiesByCase(vList, stateprovinceid, "State");
                DataView dv = dt.DefaultView;
                dv.Sort       = "category asc";
                dt            = dv.ToTable();
                Session["dt"] = dt;

                int[] i = new int[4];
                i = FindNumAmenities(dt);



                //create rdo items from categories table
                dtCategories = obj.FindNumCategories(dt);
                int    vCategoryCount = 0;
                string firstCategory  = "";
                string subCategory    = "";
                foreach (DataRow row in dtCategories.Rows)
                {
                    int index = dtCategories.Rows.IndexOf(row);
                    if (index == 0)
                    {
                        firstCategory = row["category"].ToString();
                        subCategory   = dt.Rows[0]["SubCategory"].ToString();
                    }
                    string vTemp = row["category"].ToString() + " (" + row["count"].ToString() + ")";
                    vTemp          = vTemp.Replace(" ", "&nbsp;");
                    vCategoryCount = vCategoryCount + Convert.ToInt32(row["count"].ToString());
                }
                if (!IsPostBack)
                {
                }        //numbedrooms filter
                dtCategories = obj.FindNumBedrooms(dt);

                int vBedCount = 0;
                foreach (DataRow row in dtCategories.Rows)
                {
                    vBedCount += Convert.ToInt32(row["count"]);
                }

                //Implement 404 logic less then 10 property with Prorerty in URL - Develop By Nimesh Sapovadiya
                if (Request.QueryString["category"] != null)
                {
                    Response.Clear();
                    Response.StatusCode = 404;
                    Response.End();
                }
                string dispString = "";
                if (firstCategory.Contains("_"))
                {
                    string[] strSplit = firstCategory.Split('_');
                    dispString = UppercaseFirst(strSplit[0]) + " " + UppercaseFirst(strSplit[1]) + "s";
                }
                else
                {
                    dispString = UppercaseFirst(firstCategory) + "s";
                }

                statestr           = char.ToUpper(stateprovince[0]) + stateprovince.Substring(1);
                altTag             = char.ToUpper(stateprovince[0]) + stateprovince.Substring(1) + " Vacation Rentals";
                ltrH1.Text         = char.ToUpper(stateprovince[0]) + stateprovince.Substring(1) + " Vacations";// Rentals";// And " +  dispString;
                ltrHeading.Text    = statestr + " Vacation Rentals and " + statestr + " Hotels";
                ltrStateThing.Text = char.ToUpper(stateprovince[0]) + stateprovince.Substring(1);

                hyplinkBackRegion.NavigateUrl = "/" + region.ToLower().ToLower().Replace(" ", "_") + "/" + "default.aspx";
                ltrRegion.Text = region + "<<";

                hyplnkBackLink.NavigateUrl = "/" + country.ToLower().ToLower().Replace(" ", "_") + "/" + "default.aspx";
                ltrBackText.Text           = country + "<<";
                string iframe = "<iframe height='260' width='95%' frameborder='0' src='/" + country.ToLower().ToLower().Replace(" ", "_") + "/" + stateprovince.ToLower().ToLower().Replace(" ", "_") + "/maps.aspx'></iframe>";
                googlemap.InnerHtml = iframe;
                page.Title          = char.ToUpper(stateprovince[0]) + stateprovince.Substring(1) + " Vacation Rentals, Boutique Hotels | Vacations Abroad";

                string tempcountry1 = CommonFunctions.GetSiteAddress() + "/" + country.ToLower().Replace(" ", "_") + "/" + stateprovince.ToLower().Replace(" ", "_") +
                                      "/default.aspx";
            }

            string vText = "Vacations-abroad.com is a " + stateprovince + " accommodation directory of " + stateprovince + " rentals by owner and privately owned " + stateprovince + " holiday accommodation. Our short term " + stateprovince + " rentals include luxury " +
                           stateprovince + " holiday homes, " + stateprovince + " vacation homes and " + stateprovince + " vacation home rentals which are perfect for group or family vacation rentals in " + stateprovince + " " + country;

            //TOP DEFAULT TEXT
            if (!IsPostBack)
            {
                txtCityText.Text = vText;
            }
            lblcityInfo.Text = vText;

            //BOTTOM, NO DEFAULT TEXT
            dt = VADBCommander.CityTextByStateInd(stateprovinceid.ToString());

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["cityText"] != null)
                {
                    if (!IsPostBack)
                    {
                        lblcityInfo.Text = dt.Rows[0]["cityText"].ToString();
                        txtCityText.Text = Server.HtmlDecode(dt.Rows[0]["cityText"].ToString().Replace("<br />-ipx-", Environment.NewLine));
                    }
                }
                if (dt.Rows[0]["cityText2"] != null)
                {
                    if (!IsPostBack)
                    {
                        lblInfo2.Text = Server.HtmlDecode(dt.Rows[0]["cityText2"].ToString());

                        if (string.IsNullOrEmpty(dt.Rows[0]["cityText2"].ToString()) || dt.Rows[0]["cityText2"].ToString() == "")
                        {
                            OrangeTitle.Visible = false;
                        }
                        txtCityText2.Text = Server.HtmlDecode(dt.Rows[0]["cityText2"].ToString()).Replace("<br />", Environment.NewLine);
                    }
                }
                else
                {
                    OrangeTitle.Visible   = false;
                    ltrStateThing.Visible = false;
                }
            }
            else
            {
                OrangeTitle.Visible   = false;
                ltrStateThing.Visible = false;
            }

            if (String.IsNullOrEmpty(lblcityInfo.Text))
            {
                //IF EMPTY VALUES OR 'DELETES' FROM ADMIN FOR TOP

                txtCityText.Text = vText;
                lblcityInfo.Text = vText;
            }
            if (Request.QueryString["Category"] != null)
            {
                lblInfo2.Visible    = false;
                OrangeTitle.Visible = false;
                txtCityText.Visible = false;
            }
        }
        catch (Exception ex) { lblInfo.Text = ex.Message; }

        DBConnection  obj3   = new DBConnection();
        SqlDataReader reader = obj3.ExecuteRecordSetArtificial("SELECT Cities.* FROM Cities WHERE (Cities.StateProvinceID = " + stateprovinceid + ") " + "AND EXISTS ( SELECT * FROM Properties WHERE (Properties.IfFinished = 1) AND (Properties.IfApproved = 1) AND " + "(Properties.CityID = Cities.ID)  AND NOT EXISTS (SELECT * FROM Auctions WHERE PropertyID = Properties.ID)) ORDER " + "BY City");

        foreach (DataRow dr in MainDataSet.Tables["StateProvinces"].Rows)
        {
            string temp = CommonFunctions.GetSiteAddress() + "/" + country +
                          "/" + dr["StateProvince"].ToString() + "/default.aspx";
            temp         = temp.ToLower();
            temp         = temp.Replace(' ', '_');
            rtLow3.Text += "<li><a href='" + temp + "'>" + dr["StateProvince"].ToString().Replace(" ", "&nbsp;") + ", </a></li>";
        }
        rtLow3.Text     = rtLow3.Text;
        rtHd3.InnerHtml = country + " Regions: ";

        //add counties to right column
        //add counties within state
        string query = "";

        dt = obj1.spGetRightSideCounties(stateprovinceid);
        if (dt.Rows.Count > 0)
        {
            rtCountiesHd.InnerHtml = stateprovince + " Counties";
            foreach (DataRow datarow in dt.Rows)
            {
                if (datarow["county"] is string)
                {
                    string temp = CommonFunctions.GetSiteAddress() + "/" + stateprovince + "/Holiday-Rentals/" +
                                  datarow["county"].ToString() + "-Vacation_Rentals/default.aspx";
                    temp              = temp.ToLower();
                    temp              = temp.Replace(' ', '_');
                    divCitiesRt.Text += "<li><a href='" + temp + "'>" + datarow["county"].ToString().Replace(" ", "&nbsp;") + "</a></li> ";
                }
            }
            divCitiesRt.Text = divCitiesRt.Text.Remove(divCitiesRt.Text.Length - 2, 2);
        }
        else
        {
        }

        //add counties within state
        DataTable dtCountries = obj1.spStateProvByCountries(countryid);

        foreach (DataRow row in dtCountries.Rows)
        {
            if (row["stateprovince"] is string)
            {
                string temp = CommonFunctions.GetSiteAddress() + "/" + country + "/" + row["stateprovince"].ToString() + "/default.aspx";
                temp = temp.ToLower();
                temp = temp.Replace(' ', '_');
            }
        }
        /////// common for postback and ! postback ////////
        string cities1   = "";
        string citiesNew = "";

        foreach (DataRow dr in MainDataSet.Tables["Cities"].Rows)
        {
            string temp = CommonFunctions.GetSiteAddress() + "/" + country +
                          "/" + stateprovince + "/" + dr["City"].ToString() + "/default.aspx";
            temp     = temp.ToLower();
            temp     = temp.Replace(' ', '_');
            cities1 += "<a href='" + temp + "'><span class=\"tdNoSleeps\" style=\"font-weight:normal;font-style:normal\">" + dr["City"].ToString().Replace(" ", "&nbsp;") + "</span></a>, ";
        }

        string str_cities = "";
        int    ind        = 0;
        // string cls = " class='borderright' ";
        string cls = "border-right:1px solid #0094ff;";
        string li  = "";

        foreach (DataRow dr in MainDataSet.Tables["Cities"].Rows)
        {
            string temp = "/" + country +
                          "/" + stateprovince + "/" + dr["City"].ToString() + "/default.aspx";
            temp = temp.ToLower();
            temp = temp.Replace(' ', '_');

            DataTable dt1 = new DataTable();
            dt1 = obj.PropertiesByCase(vList, Convert.ToInt32(dr["id"]), "City");

            // li = " style='" + ((ind > 4) ? "border-top:0px;" : "") + (((ind++ % 5) == 4) ? cls : "") + "'";

            citiesNew += "<li" + li + ">" +
                         "<a href='" + temp + "' class='StateTitle'>" + dr["City"].ToString() + "</a> <br/>" +
                         "<a href='" + temp + "'>" +
                         "<div class='drop-shadow effect4'><img width='160' height='125' src='/images/" + Convert.ToString(dt1.Rows[0]["PhotoImage"]) + "' alt='" + dr["City"].ToString() + " Vacation Rentals and Boutique Hotels in " + stateprovince + "' title='" + dr["City"].ToString() + " Vacation Rentals and Boutique Hotels in " + stateprovince + "' /></a></div>" +
                         "</li>";
            str_cities += dr["City"].ToString() + ", ";
        }

        str_cities = str_cities.Substring(0, str_cities.Length - 2);

        ulManiGrid.InnerHtml = citiesNew;

        string tempcountry2 = CommonFunctions.GetSiteAddress() + "/" + country.ToLower().Replace(" ", "_") + "/" + stateprovince.ToLower().Replace(" ", "_") +
                              "/default.aspx";

        string tempstate = CommonFunctions.GetSiteAddress() + "/" + country.ToLower().Replace(" ", "_") +
                           "/" + stateprovince.ToLower().Replace(" ", "_") + "/default.aspx";
        string tempcountry3 = CommonFunctions.GetSiteAddress() + "/" + country.ToLower().Replace(" ", "_") +
                              "/default.aspx";
        string tempregion = CommonFunctions.GetSiteAddress() + "/" + region.ToLower().Replace(" ", "_") +
                            "/default.aspx";

        Session["tempstate"]   = stateprovince;
        Session["tempcountry"] = country;

        //FillCitiesColumn();

        /* HtmlMeta description = new HtmlMeta();
         *
         * description.Name = "description";
         * description.Content = Description.Text.Replace("%country%", country).Replace("%stateprovince%", stateprovince).
         *   Replace("%cities%", cities);
         * // Description OVER RIDE area
         *
         * string DescripReplacement = MainDataSet.Tables["Location"].Rows[0]["descriptionoverride"].ToString();
         * if (DescripReplacement.Length > 0)
         *   description.Content = DescripReplacement;
         * description.Content = "Plan your next " + stateprovince + " vacation: where to stay and places to visit!";
         *
         * head.Controls.Add(description);*/

        Page page1 = (Page)HttpContext.Current.Handler;


        HtmlMeta newdescription = new HtmlMeta();

        int counts = AjaxProvider.getPropertyNumsbyState(stateprovinceid);

        string str_meta = "(%counts%) %state% vacation rentals and boutique hotels in %cities%.";

        newdescription.Name    = "description";
        newdescription.Content = str_meta.Replace("%state%", stateprovince).Replace("%cities%", str_cities).Replace("%counts%", counts.ToString());

        head.Controls.Add(newdescription);



        HtmlMeta keywords = new HtmlMeta();

        keywords.Name    = "keywords";
        keywords.Content = Keywords.Text.Replace("%country%", country).Replace("%stateprovince%", stateprovince).
                           Replace("%cities%", cities);
        keywords.Content = page1.Title;
        head.Controls.Add(keywords);
        // ((System.Web.UI.WebControls.Image)Master.FindControl("Logo")).AlternateText = page1.Title;
        // Page.Header.Controls.Add(new LiteralControl("<link href='http://vacations-abroad.com/css/StyleSheetBig4.css' rel='stylesheet' type='text/css'></script>"));
    }
Esempio n. 13
0
    //live
    protected void Page_Load(object sender, System.EventArgs e)
    {
        //Response.Clear();
        //Response.StatusCode = 404;
        //Response.End();
        //HttpResponse.RemoveOutputCacheItem("/CityList.aspx");
        //CommonFunctions.Connection.Open ();


        if ((Request.Params["CityID"] != null) && (Request.Params["CityID"].Length > 0))
        {
            try
            {
                cityid = Convert.ToInt32(Request.Params["CityID"]);
            }
            catch (Exception)
            {
            }
        }
        //lblcity.Text = cityid.ToString();
        //cityid = 3031;
        if (cityid == -1)
        {
            Response.Redirect(CommonFunctions.PrepareURL("InternalError.aspx"));
        }

        //  cityid = 3031;
        // propertyset = SearchProvider.getPropertyListInfoSet(strkeyword, 0, 0, 0);
        // propertylist.DataSource = propertyset;
        // propertylist.DataBind();
        // propertytypes = SearchProvider.getPropertyTypeListSet(strkeyword);
        for (int i = 0; i < 4; i++)
        {
            bedroominfo[i] = SearchProvider.getNumbersOfCityID(cityid, 0, 0, i);
        }
        for (int i = 0; i < 5; i++)
        {
            amenity_nums[i] = SearchProvider.getNumbersOfCityID(cityid, 0, amenity_id[i], 0);
        }

        for (int i = 0; i < 3; i++)
        {
            prop_nums[i] = SearchProvider.getNumbersOfCityID(cityid, prop_typeval[i], 0, 0);
        }
        // ajax_proplist = SearchProvider.getAjaxPropListSet(strkeyword, 0, 0, 0, 0, 0);

        // Response.Write(cityid + " City");
        //Response.Write(cityid);

        countryinfo = SearchProvider.getCountryInfoCityID(cityid);

        hyperRegion.NavigateUrl           = "/" + countryinfo.Region.ToLower().Replace(" ", "_") + "/default.aspx";
        hyplnkCountryBackLink.NavigateUrl = "/" + countryinfo.Country.ToLower().Replace(" ", "_") + "/default.aspx";
        hyplnkStateBackLink.NavigateUrl   = "/" + countryinfo.Country.ToLower().Replace(" ", "_") + "/" + countryinfo.StateProvince.ToLower().Replace(" ", "_") + "/default.aspx";

        ltrH11.Text  = countryinfo.City + " Vacations";
        lblcity.Text = Server.HtmlDecode(countryinfo.CityText);
        if (countryinfo.CityText == null || countryinfo.CityText == "")
        {
            lblcity.Text = String.Format("Vacations-abroad.com is a {0} {1} vacation rental directory of short term {0} vacation condos, privately owned {0} villas and {0} rentals by owner. Our unique and exotic boutique {0} hotels and luxury {0} resorts are perfect {0} {1} rentals for family and groups that are looking for vacation rentals in {0} {1}", countryinfo.City, countryinfo.Country);
        }

        DataSet ds = AjaxProvider.getProCatNumsbyCity(cityid);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            meta_str += String.Format("{1}s ({0}), ", ds.Tables[0].Rows[i][0], ds.Tables[0].Rows[i][1]).Replace("&", " ");
        }
        int ind_last = meta_str.Length - 2;

        meta_str = meta_str.Substring(0, (ind_last > 0)?ind_last:0);

        if (!IsPostBack)
        {
            txtCityText.Text  = Server.HtmlDecode(countryinfo.CityText).Replace("<br />", Environment.NewLine);
            txtCityText2.Text = Server.HtmlDecode(countryinfo.CityText2).Replace("<br />", Environment.NewLine);
            //txtCityText2.Text = countryinfo.CityText2;
            CityParam.Value = cityid.ToString();
            rproptype_id    = 0;
            rbedroom_id     = 0;
            ramenity_id     = 0;
            rsort_id        = 1;
            pagenum         = 0;
        }
        else
        {
            rproptype_id = Int32.Parse(Request.Form["proptype"]);
            rbedroom_id  = Int32.Parse(Request.Form["roomnums"]);
            ramenity_id  = Int32.Parse(Request.Form["amenitytype"]);
            rsort_id     = Int32.Parse(Request.Form["pricesort"]);
            pagenum      = Int32.Parse(Request.Form["pagenums"]);
        }


        proplistset = SearchProvider.getAjaxAllPropListSetWithCityID(cityid, rproptype_id, ramenity_id, rbedroom_id, rsort_id);
        for (int i = 0; i < proplistset.allnums; i++)
        {
            list_rating.Add(BookDBProvider.getRatingbyID(proplistset.propertyList[i].detail.ID));
        }
        // Response.Write(cityid);
        //<meta name="description" content="<%=countryinfo.City %>, <%=countryinfo.StateProvince %> <%=meta_str %>" />
        //  HtmlMeta newdescription = new HtmlMeta();

        //  newdescription.Name = "description";
        //  newdescription.Content = Server.HtmlDecode(String.Format("Our {0}, {1} vacation rentals and boutique hotels include: {2} ", countryinfo.City, countryinfo.StateProvince,meta_str));
        newdescription = String.Format("Our {0}, {1} vacation rentals and boutique hotels include: {2} ", countryinfo.City, countryinfo.StateProvince, meta_str);
        city_ds        = AjaxProvider.getCityListbyCityNum(cityid);
        //  Page.Header.Controls.Add(newdescription);
    }