Example #1
0
        private void flightbin_Click(object sender, RoutedEventArgs e)
        {
            // delete customer details code

            try
            {
                if (modelt.Text == "0" || modelt.Text == "")
                {
                    MessageBox.Show("Search flight by means of their model numbers & then Delete .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();

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

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

                    dc.SubmitChanges();

                    namet.Text  = ""; typet.Text = ""; takeofft.Text = ""; landingt.Text = "";
                    modelt.Text = "0"; seatt.Text = "0"; cabint.Text = "0";
                } // else closing
            }
            catch
            {
                MessageBox.Show("Search flight by means of their model 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!");
            }
        }
Example #3
0
        private void flightsearch_Click(object sender, RoutedEventArgs e)
        {
            // SEARCH CUSTOMER : CODE

            try
            {
                if (modelt.Text == "0" || modelt.Text == "")
                {
                    MessageBox.Show("Search Flight Details By their Model Numbers .");
                }

                airlinqDataContext dc = new airlinqDataContext();

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

                foreach (var cust in q)
                {
                    namet.Text    = cust.name;
                    typet.Text    = cust.type;
                    modelt.Text   = cust.model;
                    seatt.Text    = cust.seats;
                    cabint.Text   = cust.cabins;
                    takeofft.Text = cust.takoff;
                    landingt.Text = cust.landing;
                }
            }
            catch
            {
                MessageBox.Show("Search flight by means of their model numbers !");
            }
        }
Example #4
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!");
            }
        }
Example #5
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 routesearch_Click(object sender, RoutedEventArgs e)
        {
            // SEARCH  : CODE

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

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

                    foreach (var cust in q)
                    {
                        namet.SelectedValue = cust.name;
                        modelt.Text         = cust.model;
                        fromt.Text          = cust.startdest;
                        tot.Text            = cust.enddest;
                        takeofft.Text       = cust.takeoff;
                        landt.Text          = cust.landing;
                    }
                }
            }
            catch
            {
                MessageBox.Show("Search route Details By flight model Numbers .");
            }
        }
Example #7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (lt1.Text == "" || lt2.Password == "")
            {
                MessageBox.Show("Invalid Username or Password");
            }
            else
            {
                try
                {
                    airlinqDataContext log = new airlinqDataContext();

                    var check = from n in log.admindbs
                                where n.name == lt1.Text && n.pass == lt2.Password
                                select n;

                    foreach (var c in check)
                    {
                        MessageBox.Show(" Admin Logined Successfully");
                        home h = new home();
                        this.NavigationService.Navigate(h);
                    }
                }
                catch
                {
                    MessageBox.Show(" Login Authority Failed  ");
                }
            }
        }
        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!");
            }
        }
Example #9
0
        private void redsearch_Click(object sender, RoutedEventArgs e)
        {
            // SEARCH CUSTOMER : CODE

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

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

                    foreach (var cust in q)
                    {
                        r1.Text = cust.name;
                        r2.Text = cust.mobile;
                        r3.Text = cust.passengers;
                        r4combo.SelectedValue = cust.flight;
                        r5.Text = cust.route;
                        r6.Text = cust.seats;
                        r7.Text = cust.payment;
                    }
                }
            }
            catch
            {
                MessageBox.Show("Search Customer by means of their mobile numbers !");
            }
        }
        private void adminsearch_Click(object sender, RoutedEventArgs e)
        {
            // SEARCH : CODE

            try
            {
                if (mobilet.Text == "0" || mobilet.Text == "")
                {
                    MessageBox.Show("Search Admin Details By their Mobile Numbers .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();

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

                    foreach (var cust in q)
                    {
                        namet.Text      = cust.name;
                        mobilet.Text    = cust.mobile;
                        nict.Text       = cust.nic;
                        passt.Password  = cust.pass;
                        cpasst.Password = cust.cpass;
                    }
                }
            }
            catch
            {
                MessageBox.Show("Search Admin by means of their mobile numbers !");
            }
        }
Example #11
0
        public reservationaddxaml()
        {
            InitializeComponent();

            // retrieve flights from flight table of database
            airlinqDataContext dc = new airlinqDataContext();

            var q = from a in dc.flightdbs
                    select a.name;

            foreach (var cust in q)
            {
                r4combo.Items.Add(cust);
            }

            r4combo.SelectedIndex = 0;
        }
        public route()
        {
            InitializeComponent();


            // retrieve flights from flight table of database
            airlinqDataContext dc = new airlinqDataContext();

            var q = from a in dc.flightdbs
                    select a.name;

            foreach (var cust in q)
            {
                namet.Items.Add(cust);
            }

            namet.SelectedIndex = 0;
        }
Example #13
0
        private void empmod_Click(object sender, RoutedEventArgs e)
        {
            // update  details code

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

                    var query = from person in dc.employeedbs
                                where person.mobile == mobilet.Text
                                select person;

                    foreach (var c in query)
                    {
                        c.first       = firstt.Text;
                        c.last        = lastt.Text;
                        c.gender      = gendercombo.SelectedValue.ToString();
                        c.nationality = nationalityt.Text;
                        c.joining     = datet.SelectedDate;
                        c.mobile      = mobilet.Text;
                        c.address     = addresst.Text;
                        c.email       = emailt.Text;
                        c.department  = departt.Text;
                        c.position    = positiont.Text;
                        c.field       = feildt.Text;
                    }
                    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 Update Their Details .");
            }
        }
Example #14
0
        private void empsave_Click(object sender, RoutedEventArgs e)
        {
            // INSERT  : CODE



            try
            {
                if (firstt.Text == "" || lastt.Text == "" || nationalityt.Text == "" || addresst.Text == "" || emailt.Text == "" || departt.Text == "" || positiont.Text == "" || feildt.Text == "" || mobilet.Text == "0")
                {
                    MessageBox.Show("Don't Leave Any TextBox Empty !");
                }
                else
                {
                    var d = new airlinqDataContext();
                    var c = new employeedb();

                    c.first       = firstt.Text;
                    c.last        = lastt.Text;
                    c.gender      = gendercombo.SelectedValue.ToString();
                    c.nationality = nationalityt.Text;
                    c.joining     = datet.SelectedDate;
                    c.mobile      = mobilet.Text;
                    c.address     = addresst.Text;
                    c.email       = emailt.Text;
                    c.department  = departt.Text;
                    c.position    = positiont.Text;
                    c.field       = feildt.Text;

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

                    firstt.Text  = ""; lastt.Text = ""; nationalityt.Text = ""; addresst.Text = ""; emailt.Text = ""; departt.Text = ""; positiont.Text = ""; feildt.Text = "";
                    mobilet.Text = "0";

                    MessageBox.Show("Inserted Successfully");
                } // else closing
            }
            catch
            {
                MessageBox.Show("Issue With Database Handling ! Contact Database Administrator");
            }
        }
Example #15
0
        private void resmod_Click(object sender, RoutedEventArgs e)
        {
            // update customer details code

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

                    var query = from person in dc.reservationdbs
                                where person.mobile == r2.Text
                                select person;

                    foreach (var cust in query)
                    {
                        cust.name       = r1.Text;
                        cust.mobile     = r2.Text;
                        cust.passengers = r3.Text;
                        cust.flight     = r4combo.Text;
                        cust.route      = r5.Text;
                        cust.seats      = r6.Text;
                        cust.payment    = r7.Text;
                    }
                    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 Update Their Details .");
            }
        }
Example #16
0
        private void flightmod_Click(object sender, RoutedEventArgs e)
        {
            // update customer details code

            try
            {
                if (modelt.Text == "0" || modelt.Text == "")
                {
                    MessageBox.Show("Search flight by means of their model numbers & then Update .");
                }
                else
                {
                    airlinqDataContext dc = new airlinqDataContext();

                    var query = from person in dc.flightdbs
                                where person.model == modelt.Text
                                select person;

                    foreach (var c in query)
                    {
                        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;
                    }
                    dc.SubmitChanges();

                    namet.Text  = ""; typet.Text = ""; takeofft.Text = ""; landingt.Text = "";
                    modelt.Text = "0"; seatt.Text = "0"; cabint.Text = "0";
                } // else closing
            }

            catch
            {
                MessageBox.Show("Search flight by means of their model numbers & then Update Their Details .");
            }
        }
Example #17
0
        private void empsearch_Click(object sender, RoutedEventArgs e)
        {
            // SEARCH : CODE

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

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

                    foreach (var emp in q)
                    {
                        firstt.Text = emp.first;
                        lastt.Text  = emp.last;
                        gendercombo.SelectedValue = emp.gender;
                        nationalityt.Text         = emp.nationality;
                        datet.SelectedDate        = emp.joining;
                        mobilet.Text   = emp.mobile;
                        addresst.Text  = emp.address;
                        emailt.Text    = emp.email;
                        departt.Text   = emp.department;
                        positiont.Text = emp.position;
                        feildt.Text    = emp.field;
                    }
                }
            }
            catch
            {
                MessageBox.Show("Search Employee by means of their mobile numbers !");
            }
        }
        private void routemod_Click(object sender, RoutedEventArgs e)
        {
            // update details code

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

                    var query = from person in dc.routesdbs
                                where person.model == modelt.Text
                                select person;

                    foreach (var c in query)
                    {
                        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;
                    }
                    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 Update Their Details .");
            }
        }
Example #19
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");
            }
        }
Example #20
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");
            }
        }
        private void adminmod_Click(object sender, RoutedEventArgs e)
        {
            // update details code

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

                    var query = from person in dc.admindbs
                                where person.mobile == mobilet.Text
                                select person;

                    foreach (var c in query)
                    {
                        c.name   = namet.Text;
                        c.mobile = mobilet.Text;
                        c.nic    = nict.Text;
                        c.pass   = passt.Password;
                        c.cpass  = cpasst.Password;
                    }
                    dc.SubmitChanges();

                    namet.Text = ""; mobilet.Text = "0"; nict.Text = "0"; passt.Password = ""; cpasst.Password = "";
                } // else closing
            }

            catch
            {
                MessageBox.Show("Search Admin by means of their mobile numbers & then Update Their Details .");
            }
        }
        private void adminsave_Click(object sender, RoutedEventArgs e)
        {
            // INSERT : CODE



            try
            {
                if (namet.Text == "" || mobilet.Text == "" || nict.Text == "" || passt.Password == "" || cpasst.Password == "")
                {
                    MessageBox.Show("Don't Leave Any TextBox Empty !");
                }
                else
                {
                    var d = new airlinqDataContext();
                    var c = new admindb();

                    c.name   = namet.Text;
                    c.mobile = mobilet.Text;
                    c.nic    = nict.Text;
                    c.pass   = passt.Password;
                    c.cpass  = cpasst.Password;

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

                    namet.Text = ""; mobilet.Text = "0"; nict.Text = "0"; passt.Password = ""; cpasst.Password = "";

                    MessageBox.Show("Inserted Successfully");
                } // else closing
            }
            catch
            {
                MessageBox.Show("Issue With Database Handling ! Contact Database Administrator");
            }
        }
        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");
            }
        }