Example #1
0
        private void flightsaveb_Click(object sender, RoutedEventArgs e)
        {
            // INSERT  : CODE

            try
            {
                if (namet.Text == "" || typet.Text == "" || takeofft.Text == "" || landingt.Text == "" || modelt.Text == "0" || seatt.Text == "0" || cabint.Text == "0")
                {
                    MessageBox.Show("Don't Leave Any TextBox Empty !");
                }
                else
                {
                    var d = new airlinqDataContext();
                    var c = new flightdb();

                    c.name    = namet.Text;
                    c.type    = typet.Text;
                    c.model   = modelt.Text;
                    c.seats   = seatt.Text;
                    c.cabins  = cabint.Text;
                    c.takoff  = takeofft.Text;
                    c.landing = landingt.Text;

                    d.flightdbs.InsertOnSubmit(c);
                    d.SubmitChanges();

                    namet.Text  = ""; typet.Text = ""; takeofft.Text = ""; landingt.Text = "";
                    modelt.Text = "0"; seatt.Text = "0"; cabint.Text = "0";

                    MessageBox.Show("Inserted Successfully");
                } // else closing
            }
            catch
            {
                MessageBox.Show("Issue With Database Handling ! Contact Database Administrator");
            }
        }
Example #2
0
 partial void Deleteflightdb(flightdb instance);
Example #3
0
 partial void Updateflightdb(flightdb instance);
Example #4
0
 partial void Insertflightdb(flightdb instance);