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"); } }
partial void Updateroutesdb(routesdb instance);
partial void Deleteroutesdb(routesdb instance);
partial void Insertroutesdb(routesdb instance);