using System; using System.Globalization; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace AeroNet.ops { /// /// Список новостей /// public class ops_NewsList : Common { protected int t; protected string Type; protected DateTime cdata; protected System.Web.UI.WebControls.Calendar calNews; protected System.Web.UI.WebControls.Panel NewsListPanel; protected System.Web.UI.HtmlControls.HtmlTable Table1; protected System.Web.UI.WebControls.DataGrid NewsList; protected void calSelectChange(Object sender, EventArgs e) { cdata = calNews.SelectedDate; Response.Redirect("/ops/ops_NewsList.aspx?t="+t.ToString()+"&cdata="+cdata.ToShortDateString(),true); } protected void calOnLoad(Object sender, EventArgs e) { calNews.SelectedDate = cdata; calNews.VisibleDate = cdata; } protected void GetType(int t) { switch(t) { case 1: Type = "Гражданская авиация"; break; case 2: Type = "Военная авиация"; break; case 3: Type = "Авиапромышленность"; break; case 4: Type = "Космос"; break; case 5: Type = "Происшествия"; break; default: Type = "Гражданская авиация"; break; } } //******************************************************* // // Вспомогательный метод PopulateNewsList используется // для динамического заполнения GridControl. // //******************************************************* private void Page_Load(object sender, System.EventArgs e) { Session["exit"]="/ops/ops_NewsList.aspx"; OpsLogin(); OpsMenu(); //Считывание категории новостей из строки запроса if (Request.QueryString["t"] == null) { t = 1; } else { t = Convert.ToInt32(Request.QueryString["t"]); } //Считывание даты из строки запроса if (Request.QueryString["cdata"] == null) { cdata = DateTime.Now; } else { cdata = Convert.ToDateTime(Request.QueryString["cdata"]); } calNews.SelectedDate = cdata; GetType(t); ops_NewsDB newsList = new ops_NewsDB(); NewsList.DataSource = newsList.GetNewsList(t,cdata); NewsList.DataBind(); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } }