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 Pension2 : BasePage { public string m_Pageng { get { if (ViewState["m_Pageng"] != null) { return ViewState["m_Pageng"].ToString(); } else { return "10"; } } set { ViewState["m_Pageng"] = value; } } protected void Page_PreRender(object sender, EventArgs e) { if (m_Pageng == "10") { Button1.Text = (string)this.GetLocalResourceObject("Showall"); GridView1.PageIndex = 0; GridView1.PageSize = 10; GridView1.PagerSettings.Visible = false; } else { Button1.Text = (string)this.GetLocalResourceObject("TOP10"); GridView1.PageSize = 20; GridView1.PagerSettings.Visible = true; } } protected void Page_Load(object sender, EventArgs e) { this.CurrentPage = Globals.CurrentPageId.Pension2; Button2.OnClientClick = "if(getelementbyid('" + HiddenField1.ClientID + "').value == '') {alert('" + Resources.Common.LID_MESSAGE + "'); return false;} return true; "; Panel pan_Description = new Panel(); pan_Description.Attributes.Add("id", "Description1"); Label text_Description = new Label(); text_Description.Text = (string)this.GetLocalResourceObject("Description1"); pan_Description.Controls.Add(text_Description); pnSection1.Controls.Add(pan_Description); LabelUpdText.Text = GetGlobalResourceObject("Common", "Updatedate").ToString(); LabelUpdDate.Text = PageUpdatedDate; BusinessLayer.Controllers.ControllerArticle controller = new BusinessLayer.Controllers.ControllerArticle(); BusinessLayer.Entities.Article article = new BusinessLayer.Entities.Article(); article = controller.Get((int)Globals.AJAXHelp.Pension2_RedButton1); HelpButtonAjax20.Text = "
" + article.Title + "

" + article.ShortText; } 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.Pension2_Inbest); ((Controls_HelpButtonAjax)sender).Text = "
" + article.Title + "

" + article.ShortText; } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label ll; HtmlInputCheckBox ck; ll = (Label)e.Row.Cells[0].FindControl("Label1"); 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; } } } Label lInb; lInb = (Label)e.Row.Cells[2].FindControl("LabInbest"); if (lInb.Text == "") { lInb.Text = "-"; } else { double m_Inb = Convert.ToDouble(lInb.Text); lInb.Text = m_Inb.ToString("0"); lInb.Font.Bold = true; lInb.ForeColor = InbestColor(lInb.Text); } } } protected void Button1_Click(object sender, EventArgs e) { if (m_Pageng == "10") { m_Pageng = "30"; } else { m_Pageng = "10"; } } protected void Button2_Click(object sender, EventArgs e) { // Go("Lid.aspx?IDS=" + HiddenField1.Value); 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; } } Go("Lid.aspx?MSG=" + HttpUtility.HtmlEncode(m_ids)); } protected void LinkButton4_Click(object sender, EventArgs e) { if (sortLink4 != null) { if (bool.Parse(sortLink4.Value)) { GridView1.Sort("AVG_M", SortDirection.Descending); sortLink4.Value = "false"; } else { GridView1.Sort("AVG_M", SortDirection.Ascending); sortLink4.Value = "true"; } } } protected void LinkButton2_Click(object sender, EventArgs e) { if (sortLink2 != null) { if (bool.Parse(sortLink2.Value)) { GridView1.Sort("Inbest", SortDirection.Descending); sortLink2.Value = "false"; } else { GridView1.Sort("Inbest", SortDirection.Ascending); sortLink2.Value = "true"; } } } 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.Pension2_Average); ((Controls_HelpButtonAjax)sender).Text = "
" + article.Title + "

" + article.ShortText; } }