/// <summary>
        /// Create a new plane object.
        /// </summary>
        /// <param name="planeID">Initial value of the PlaneID property.</param>
        public static plane Createplane(global::System.Int32 planeID)
        {
            plane plane = new plane();

            plane.PlaneID = planeID;
            return(plane);
        }
Esempio n. 2
0
        protected void insertPlane_Click(object sender, EventArgs e)
        {
            projectCUPU1Entities1 entity = new projectCUPU1Entities1();
            plane pl       = new plane();
            var   textbox1 = LoginView1.FindControl("TextBox1") as TextBox;
            var   textbox2 = LoginView1.FindControl("DropDownList1") as DropDownList;
            var   textbox3 = LoginView1.FindControl("DropDownList2") as DropDownList;
            var   textbox4 = LoginView1.FindControl("TextBox4") as TextBox;
            var   textbox5 = LoginView1.FindControl("DropDownList3") as DropDownList;

            pl.PlaneName      = textbox1.Text;
            pl.PlaneType      = textbox2.SelectedValue.ToString();
            pl.EngineType     = textbox3.SelectedValue.ToString();
            pl.NumberOfEngine = Int32.Parse(textbox4.Text);
            pl.PlaneImage     = textbox5.SelectedValue.ToString();

            entity.AddToplanes(pl);
            entity.SaveChanges();

            Response.Redirect("Plane.aspx");
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the planes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToplanes(plane plane)
 {
     base.AddObject("planes", plane);
 }