using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.SqlClient; 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 { /// /// Summary description for aircraft1. /// public class aircraft1 : Common { protected string id; protected int i; protected int j; protected int k; protected string images; protected void PrintAircraft() { // Соединение с SQL-сервером SqlConnection connAircraft = new SqlConnection(connString); //Создать команду SqlCommand cmdAircraft = new SqlCommand(("SELECT * FROM V_Aircraft WHERE aircraftID="+id), connAircraft); //Открыть соединение connAircraft.Open(); //Создать DataReader и считать данные SqlDataReader drAircraft; drAircraft = cmdAircraft.ExecuteReader(); if (drAircraft.Read()) { Response.Write (""); Response.Write ("

"+drAircraft["countryRus"]+"


"); if (drAircraft["fullname"] != null) {Response.Write ("

"+drAircraft["fullname"]+"


");} Response.Write ("
"+drAircraft["name"]+" "+drAircraft["ACname"]+"
"); Response.Write (""); if (drAircraft["ACnote"] != null) {Response.Write ("

"+drAircraft["ACnote"]+"


");} //Считываем количество фотографий и название фото i = Convert.ToInt32(drAircraft["ACimagesCounter"]); images = drAircraft["ACimages"].ToString() ; } else { Response.Write ("

Ошибка сервера ...

"); } //Закрываем DataReader и соединение drAircraft.Close(); connAircraft.Close(); } protected void PrintImages() { for (int j = 1; j <= i; j++) { if ((j % 5) == 1) { Response.Write ("        "); } //

"); } else { Response.Write ("       "); } } } private void Page_Load(object sender, System.EventArgs e) { //Загрузить верхнее меню TopMenu(); //Получить id из строки запроса if (Request.QueryString["id"] == null) { id = "1"; } else { id = Request.QueryString["id"]; } } #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 } }