private void routesave_Click(object sender, RoutedEventArgs e)
        {
            // INSERT : CODE

            try
            {
                if (fromt.Text == "" || tot.Text == "" || takeofft.Text == "" || landt.Text == "" || modelt.Text == "0")
                {
                    MessageBox.Show("Don't Leave Any TextBox Empty !");
                }
                else
                {
                    var d = new airlinqDataContext();
                    var c = new routesdb();

                    c.name      = namet.SelectedValue.ToString();
                    c.model     = modelt.Text;
                    c.startdest = fromt.Text;
                    c.enddest   = tot.Text;
                    c.takeoff   = takeofft.Text;
                    c.landing   = landt.Text;

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

                    fromt.Text  = ""; tot.Text = ""; takeofft.Text = ""; landt.Text = "";
                    modelt.Text = "0";

                    MessageBox.Show("Inserted Successfully");
                } // else closing
            }
            catch
            {
                MessageBox.Show("Issue With Database Handling ! Contact Database Administrator");
            }
        }
Exemple #2
0
 partial void Updateroutesdb(routesdb instance);
Exemple #3
0
 partial void Deleteroutesdb(routesdb instance);
Exemple #4
0
 partial void Insertroutesdb(routesdb instance);