예제 #1
0
        private void empbin_Click(object sender, RoutedEventArgs e)
        {
            // delete  details code

            try
            {
                if (mobilet.Text == "0" || mobilet.Text == "")
                {
                    MessageBox.Show("Search Employee Details By their Mobile Numbers & then Delete .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();
                    var c = new reservationdb();

                    var q = from a in dc.employeedbs
                            where a.mobile == mobilet.Text
                            select a;

                    foreach (var cust in q)
                    {
                        dc.employeedbs.DeleteOnSubmit(cust);
                    }

                    dc.SubmitChanges();

                    firstt.Text  = ""; lastt.Text = ""; nationalityt.Text = ""; addresst.Text = ""; emailt.Text = ""; departt.Text = ""; positiont.Text = ""; feildt.Text = "";
                    mobilet.Text = "0";
                } // else closing
            }
            catch
            {
                MessageBox.Show("Search Employee by means of their mobile numbers & then Delete!");
            }
        }
예제 #2
0
        private void resdel_Click(object sender, RoutedEventArgs e)
        {
            // delete customer details code

            try
            {
                if (r2.Text == "0" || r2.Text == "")
                {
                    MessageBox.Show("Search Customer Details By their Mobile Numbers & then Delete .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();
                    var c = new reservationdb();

                    var q = from a in dc.reservationdbs
                            where a.mobile == r2.Text
                            select a;

                    foreach (var cust in q)
                    {
                        dc.reservationdbs.DeleteOnSubmit(cust);
                    }

                    dc.SubmitChanges();

                    r1.Text = ""; r5.Text = "";
                    r2.Text = "0"; r3.Text = "0"; r6.Text = "0"; r7.Text = "0";
                } // else closing
            }
            catch
            {
                MessageBox.Show("Search Customer by means of their mobile numbers & then Delete!");
            }
        }
        private void adminbin_Click(object sender, RoutedEventArgs e)
        {
            // delete details code

            try
            {
                if (mobilet.Text == "0" || mobilet.Text == "")
                {
                    MessageBox.Show("Search Delete Details By their Mobile Numbers & then Delete .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();
                    var c = new reservationdb();

                    var q = from a in dc.admindbs
                            where a.mobile == mobilet.Text
                            select a;

                    foreach (var cust in q)
                    {
                        dc.admindbs.DeleteOnSubmit(cust);
                    }

                    dc.SubmitChanges();

                    namet.Text = ""; mobilet.Text = "0"; nict.Text = "0"; passt.Password = ""; cpasst.Password = "";
                } // else closing
            }
            catch
            {
                MessageBox.Show("Search Delete by means of their mobile numbers & then Delete!");
            }
        }
        private void routebin_Click(object sender, RoutedEventArgs e)
        {
            // delete  details code

            try
            {
                if (modelt.Text == "0" || modelt.Text == "")
                {
                    MessageBox.Show("Search route Details By flight model Numbers & then Delete .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();
                    var c = new reservationdb();

                    var q = from a in dc.routesdbs
                            where a.model == modelt.Text
                            select a;

                    foreach (var cust in q)
                    {
                        dc.routesdbs.DeleteOnSubmit(cust);
                    }

                    dc.SubmitChanges();

                    fromt.Text  = ""; tot.Text = ""; takeofft.Text = ""; landt.Text = "";
                    modelt.Text = "0";
                } // else closing
            }
            catch
            {
                MessageBox.Show("Search route Details By flight model Numbers & then Delete!");
            }
        }
예제 #5
0
        private void ressaveb_Click(object sender, RoutedEventArgs e)
        {
            // INSERT CUSTOMER : CODE



            try
            {
                if (r1.Text == "" || r2.Text == "" || r3.Text == "" || r5.Text == "" || r6.Text == "" || r7.Text == "")
                {
                    MessageBox.Show("Don't Leave Any TextBox Empty !");
                }
                else
                {
                    var d = new airlinqDataContext();
                    var c = new reservationdb();

                    c.name       = r1.Text;
                    c.mobile     = r2.Text;
                    c.passengers = r3.Text;
                    c.flight     = r4combo.Text;
                    c.route      = r5.Text;
                    c.seats      = r6.Text;
                    c.payment    = r7.Text;

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

                    r1.Text = ""; r5.Text = "";
                    r2.Text = "0"; r3.Text = "0"; r6.Text = "0"; r7.Text = "0";

                    MessageBox.Show("Inserted Successfully");
                } // else closing
            }
            catch
            {
                MessageBox.Show("Issue With Database Handling ! Contact Database Administrator");
            }
        }
예제 #6
0
 partial void Deletereservationdb(reservationdb instance);
예제 #7
0
 partial void Updatereservationdb(reservationdb instance);
예제 #8
0
 partial void Insertreservationdb(reservationdb instance);