GIF89;a GIF89;a using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using BusinessLayer.Controllers; using Globals; public partial class Realty : BasePage { protected void Page_Load(object sender, EventArgs e) { this.CurrentPage = Globals.CurrentPageId.Realty; Button2.OnClientClick = "if(getelementbyid('" + HiddenField1.ClientID + "').value == '') {alert('" + Resources.Common.LID_MESSAGE + "'); return false;} return true; "; Button2.Visible=false; LabelUpdText.Text = GetGlobalResourceObject("Common", "Updatedate").ToString(); LabelUpdDate.Text = PageUpdatedDate; } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Button2.Visible = true; Label ll; HtmlInputCheckBox ck; ll = (Label)e.Row.Cells[0].FindControl("LabBuff1"); ck = (HtmlInputCheckBox)e.Row.Cells[0].FindControl("Checkbox2"); ck.Value = ll.Text; ck.Attributes.Add("onclick", "javascript:Checkbox1_onclick(this,'" + HiddenField1.ClientID + "')"); string checkval = HiddenField1.Value; string[] archeck = checkval.Split(','); foreach (string i in archeck) { if (i != "") { if (i == ck.Value) { ck.Checked = true; } } } ll = (Label)e.Row.Cells[2].FindControl("LabRating"); if (ll.Text == "") { ll.Text = "-"; } else ll.Text = decimal.Parse(ll.Text).ToString("0.00"); ll = (Label)e.Row.Cells[2].FindControl("LabDangerous"); if (ll.Text == "") { ll.Text = "-"; } else ll.Text = decimal.Parse(ll.Text).ToString("0.00"); ll = (Label)e.Row.Cells[2].FindControl("LabAvarage"); ll.Text = Convert.ToDecimal(ll.Text).ToString("0.00"); } } protected void Button2_Click(object sender, EventArgs e) { string[] aMsg = HiddenField1.Value.Split(','); string m_ids = ""; foreach (string m_msg in aMsg) { if (m_ids != "") { m_ids += ", " + m_msg; } else { m_ids += m_msg; } } Page.Session.Add("ToLid_MSG", m_ids); Go("Lid.aspx"); } public void hlpButtAjax_Load(object sender, EventArgs e) { ControllerArticle CtrlArticle = new ControllerArticle(); BusinessLayer.Entities.Article article = new BusinessLayer.Entities.Article(); article = CtrlArticle.Get((int)Globals.AJAXHelp.Realty_Dangerous); ((Controls_HelpButtonAjax)sender).Text = "
" + article.Title + "

" + article.ShortText; } public void hlpButtAjax2_Load(object sender, EventArgs e) { ControllerArticle CtrlArticle = new ControllerArticle(); BusinessLayer.Entities.Article article = new BusinessLayer.Entities.Article(); article = CtrlArticle.Get((int)Globals.AJAXHelp.Realty_AVG); ((Controls_HelpButtonAjax)sender).Text = "
" + article.Title + "

" + article.ShortText; } public void hlpButtAjax3_Load(object sender, EventArgs e) { ControllerArticle CtrlArticle = new ControllerArticle(); BusinessLayer.Entities.Article article = new BusinessLayer.Entities.Article(); article = CtrlArticle.Get((int)Globals.AJAXHelp.Realty_Rating); ((Controls_HelpButtonAjax)sender).Text = "
" + article.Title + "

" + article.ShortText; } protected void LinkButton2_Click(object sender, EventArgs e) { if (sortDangerous != null) { if (bool.Parse(sortDangerous.Value)) { GridView1.Sort("Dangerous", SortDirection.Descending); sortDangerous.Value = "false"; } else { GridView1.Sort("Dangerous", SortDirection.Ascending); sortDangerous.Value = "true"; } } } protected void LinkButton22_Click(object sender, EventArgs e) { if (sortAvarage != null) { if (bool.Parse(sortAvarage.Value)) { GridView1.Sort("Avarage", SortDirection.Descending); sortAvarage.Value = "false"; } else { GridView1.Sort("Avarage", SortDirection.Ascending); sortAvarage.Value = "true"; } } } protected void LinkButton23_Click(object sender, EventArgs e) { if (sortRating != null) { if (bool.Parse(sortRating.Value)) { GridView1.Sort("Rating", SortDirection.Descending); sortRating.Value = "false"; } else { GridView1.Sort("Rating", SortDirection.Ascending); sortRating.Value = "true"; } } } }