protected void imgSavedSearch_Click(object sender, ImageClickEventArgs e) { MiscActivity.AddSavedSearch(txtEmail.Text, rbList.SelectedValue, ddlWhere.SelectedValue, txtFromPrice.Text, txtToPrice.Text, ddlFromBedroom.SelectedValue, ddlToBedroom.SelectedValue, ddlPropertyType.SelectedValue); Search(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { txtUsername.Text = MiscActivity.GetSettings("AdminUser").ToString(); } }
protected void imgUnsubscribe_Click(object sender, ImageClickEventArgs e) { try { MiscActivity.NewsletterSubscribtionActivate(txtEmail.Value); } catch { } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string email = Request.Params["Email"]; MiscActivity.NewsletterSubscribtion(email, false); ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "imgSubmit", "<script language='javascript'>alert('" + this.GetLocalResourceObject("Text.EmailUnsubscribed") + "');</script>", false); Response.Redirect("~/Index.aspx"); } }
protected void imgDisplayResults_Click(object sender, ImageClickEventArgs e) { DataRow row = MiscActivity.GetSavedSearch(txtEmail.Text); if (row != null) { rbList.SelectedValue = row["IWantTo"] != DBNull.Value ? row["IWantTo"].ToString() : "1"; ddlWhere.SelectedValue = row["Where"] != DBNull.Value ? row["Where"].ToString() : ""; txtFromPrice.Text = row["FromPriceRange"] != DBNull.Value ? row["FromPriceRange"].ToString() : ""; txtToPrice.Text = row["ToPriceRange"] != DBNull.Value ? row["ToPriceRange"].ToString() : ""; ddlFromBedroom.SelectedValue = row["FromBedroomNbr"] != DBNull.Value ? row["FromBedroomNbr"].ToString() : ""; ddlToBedroom.SelectedValue = row["ToBedroomNbr"] != DBNull.Value ? row["ToBedroomNbr"].ToString() : ""; ddlPropertyType.SelectedValue = row["PropertyType"] != DBNull.Value ? row["PropertyType"].ToString() : ""; } Search(); }
protected void imgSbscribe_Click(object sender, ImageClickEventArgs e) { bool isHuman = SampleCaptcha.Validate(CaptchaCodeTextBox.Text); CaptchaCodeTextBox.Text = null; if (isHuman) { try { MiscActivity.NewsletterSubscribtionActivate(txtEmail.Value); //StringBuilder builder = new StringBuilder(EmailTemplates.NewsletterSubscribe); //builder = builder.Replace("#SubscribtionLink#", BAL.Common.GetSettings("Domain") + "NewsletterUnSubscribe.aspx?Email=" + txtEmail.Value); //BAL.Common.SendEmail(new string[] { BAL.Common.GetSettings("EmailFrom") }, null, "Sodeco Gestion Newsletter Subscribtion", builder.ToString()); //ScriptManager.RegisterClientScriptBlock(imgSbscribe, typeof(Page), "imgSbscribe", "<script language='javascript'>alert('" + this.GetLocalResourceObject("Text.EmailSubscribe") + "');</script>", false); } catch { } } else { } }
private void LoadForm() { string whereClause = ""; if (!String.IsNullOrEmpty(Request.Params["PRL"])) { whereClause = String.Concat(" WHERE PRL like '%", Request.Params["PRL"], "%'"); } else if (!String.IsNullOrEmpty(Request.Params["hot"])) { whereClause = String.Concat(" WHERE closed = 1"); } else { string propertyFor = Request.Params["For"]; string where = ""; if (ddlNeigh.SelectedValue != "") { where = ddlNeigh.SelectedValue; } else { where = Request.Params["Where"]; } string qadaa = Request.Params["qadaa"]; string priceFrom = Request.Params["PriceFrom"]; string priceTo = Request.Params["PriceTo"]; string bdFrom = Request.Params["BdFrom"]; string bdTo = Request.Params["BdTo"]; string type = Request.Params["Type"]; string newProp = Request.Params["New"]; string sizeFrom = Request.Params["SizeFrom"]; string sizeTo = Request.Params["SizeTo"]; if (propertyFor == null) { propertyFor = ""; } //if (propertyFor.ToLower() == "short") //{ // ltrTitle.Text = GetLocalResourceObject("Text.PropertiesShortRent").ToString(); //} //else if (propertyFor.ToLower() == "long") //{ // ltrTitle.Text = GetLocalResourceObject("Text.PropertiesLongRent").ToString(); //} //else if (propertyFor.ToLower() == "sale") //{ // ltrTitle.Text = GetLocalResourceObject("Text.PropertiesBuy").ToString(); //} //else //{ // ltrTitle.Text = GetLocalResourceObject("Text.Properties").ToString(); //} if (!String.IsNullOrEmpty(propertyFor) && propertyFor != "All") { whereClause = String.Concat(" WHERE PropertyFor like '%", propertyFor, "%'"); } if (!String.IsNullOrEmpty(where)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } whereClause = String.Concat(whereClause, "District = '", where, "'"); } if (!String.IsNullOrEmpty(qadaa)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } whereClause = String.Concat(whereClause, "qadaa = '", qadaa, "'"); } if (Request["New"] != null && !String.IsNullOrEmpty(Request["New"].ToString())) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } if (Request["New"].ToString() == "true") { whereClause = String.Concat(whereClause, "(quality = 'Not Completed' or quality = 'Under construction' or quality = 'Building site' or quality = 'Core & Shell') "); } else { whereClause = String.Concat(whereClause, "quality = '", Request["New"].ToString(), "'"); } } if (!String.IsNullOrEmpty(priceFrom) || !String.IsNullOrEmpty(priceTo)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } if (!String.IsNullOrEmpty(priceFrom) && !String.IsNullOrEmpty(priceTo)) { if (propertyFor == "All") { whereClause = String.Concat(whereClause, "((", priceFrom, " <= SalePrice AND SalePrice <= ", priceTo, ") OR (", priceFrom, " <= RentPrice AND RentPrice<= ", priceTo, "))"); } if (propertyFor == Enums.PropertyFor.Sale.ToString()) { whereClause = String.Concat(whereClause, "(", priceFrom, " <= SalePrice AND SalePrice <= ", priceTo, ")"); } if (propertyFor.ToLower() == Enums.PropertyFor.Rent.ToString().ToLower() || propertyFor.ToLower() == "short" || propertyFor.ToLower() == "long") { whereClause = String.Concat(whereClause, "(", priceFrom, " <= RentPrice AND RentPrice<= ", priceTo, ")"); } } else { if (!String.IsNullOrEmpty(priceFrom)) { if (propertyFor == "All") { whereClause = String.Concat(whereClause, "((", priceFrom, " <= SalePrice", ") OR (", priceFrom, " <= RentPrice", "))"); } if (propertyFor == Enums.PropertyFor.Sale.ToString()) { whereClause = String.Concat(whereClause, "(", priceFrom, " <= SalePrice ", ")"); } if (propertyFor.ToLower() == Enums.PropertyFor.Rent.ToString().ToLower() || propertyFor.ToLower() == "short" || propertyFor.ToLower() == "long") { whereClause = String.Concat(whereClause, "(", priceFrom, " <= RentPrice ", ")"); } } if (!String.IsNullOrEmpty(priceTo)) { if (propertyFor == "All") { whereClause = String.Concat(whereClause, "((", "SalePrice <= ", priceTo, ") OR (", " RentPrice<= ", priceTo, "))"); } if (propertyFor == Enums.PropertyFor.Sale.ToString()) { whereClause = String.Concat(whereClause, "(", "SalePrice <= ", priceTo, ")"); } if (propertyFor.ToLower() == Enums.PropertyFor.Rent.ToString().ToLower() || propertyFor.ToLower() == "short" || propertyFor.ToLower() == "long") { whereClause = String.Concat(whereClause, "(", "RentPrice<= ", priceTo, ")"); } } } } if (!String.IsNullOrEmpty(sizeFrom) || !String.IsNullOrEmpty(sizeTo)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } if (!String.IsNullOrEmpty(sizeFrom) && !String.IsNullOrEmpty(sizeTo)) { whereClause = String.Concat(whereClause, "(", sizeFrom, " <= size AND size <= ", sizeTo, ")"); } else { if (!String.IsNullOrEmpty(sizeFrom)) { if (propertyFor == "All") { whereClause = String.Concat(whereClause, "((", sizeFrom, " <= size", ") OR (", sizeFrom, " <= size", "))"); } } if (!String.IsNullOrEmpty(sizeTo)) { if (propertyFor == "All") { whereClause = String.Concat(whereClause, "((", "size <= ", sizeTo, ") OR (", " size<= ", sizeTo, "))"); } } } } if (!String.IsNullOrEmpty(bdFrom) || !String.IsNullOrEmpty(bdTo)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } if (!String.IsNullOrEmpty(bdFrom) && !String.IsNullOrEmpty(bdTo)) { whereClause = string.Concat(whereClause, "(", bdFrom, "<= TotalBedrooms AND TotalBedrooms <=", bdTo, ")"); } else { if (!String.IsNullOrEmpty(bdFrom)) { whereClause = string.Concat(whereClause, "(", bdFrom, "<= TotalBedrooms", ")"); } if (!String.IsNullOrEmpty(bdTo)) { whereClause = string.Concat(whereClause, "(", "TotalBedrooms <=", bdTo, ")"); } } } if (!String.IsNullOrEmpty(type)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } whereClause = String.Concat(whereClause, "(PropertyType like '%", type, "%')"); } if (!String.IsNullOrEmpty(newProp)) { if (String.IsNullOrEmpty(whereClause)) { whereClause = " WHERE "; } else { whereClause = String.Concat(whereClause, " AND "); } whereClause = String.Concat(whereClause, "(StartDate + ", MiscActivity.GetSettings("DaysCount").ToString(), " >= GETDATE())"); } } if (sqlSort != "") { whereClause += " order by " + sqlSort; } else { whereClause += " order by [StartDate] desc"; } pagesize = 5; pds.DataSource = new BAL.Property().GetBySearchTable(whereClause).AsDataView(); lblSearchResult.Text = pds.DataSourceCount.ToString(); Session["propCount"] = pds.Count.ToString(); //lblRecordCount.Text = pds.Count.ToString(); pds.AllowPaging = true; pds.PageSize = pagesize; if (CurrentPage >= pds.PageCount - 1) { CurrentPage = pds.PageCount - 1; btnNext.Enabled = false; //btnNext2.Enabled = false; } else { btnNext.Enabled = true; //btnNext2.Enabled = true; } if (CurrentPage <= 0) { CurrentPage = 0; btnPrev.Enabled = false; //btnPrev2.Enabled = false; } else { btnPrev.Enabled = true; //btnPrev2.Enabled = true; } pds.CurrentPageIndex = CurrentPage; if (pds != null && pds.Count > 0) { //dtPaging.SelectedIndex = pds.CurrentPageIndex; //dlPaging2.SelectedIndex = pds.CurrentPageIndex; propsRepeater.DataSource = pds; propsRepeater.DataBind(); } else { propsRepeater.Visible = false; } DoPaging(); }
protected void btnChangePassword_Click(object sender, EventArgs e) { MiscActivity.UpdateSettings("Password", txtPassword.Text); Session["IsAuthenticated"] = false; Response.Redirect("Login.aspx"); }
private void BindGrid() { gvLKUP.DataSource = MiscActivity.NewsletterGetAll(); gvLKUP.DataBind(); }
protected void btnActivateEmail_Click(object sender, CommandEventArgs e) { MiscActivity.NewsletterSubscribtionActivate(e.CommandArgument.ToString()); BindGrid(); }