Exemplo n.º 1
0
        private void label1_Click(object sender, EventArgs e)
        {
            FlightList F = new FlightList(ps);

            F.FuncProfession("Manager");
            F.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void label1_Click(object sender, EventArgs e)
        {
            FlightList F2 = new FlightList(ps);

            F2.FuncProfession("Admin");
            F2.Show();
            this.Hide();
        }
Exemplo n.º 3
0
 public Add(string FlName, string time, string Date, string Route, FlightList F)
 {
     if (FlName.Equals("") || time.Equals("") || Date.Equals("") || Route.Equals(""))
     {
         F.ErrorMassage("Fill all the entries correctly");
     }
     else
     {
         FLIGHT = FlName; DTIME = time; DATE = Date; ROUTE = Route;
     }
 }
Exemplo n.º 4
0
        public void DeleteFlight(int Fno, string flight, string dtime, string ddate, string route, FlightList F)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
            var             str  = from a in cntx.Flights
                                   where a.Flight_No == Fno
                                   select a;


            Flight fl = str.First();

            cntx.Flights.DeleteOnSubmit(fl);
            cntx.SubmitChanges();

            cntx.Dispose();
        }
Exemplo n.º 5
0
        /*     public void DataLogin(string User, string password,int b,Add add,Login l) {
         *
         *       MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
         *
         *
         *          b = l.a;
         *
         *
         *
         *
         *
         *           if (b == 0)
         *           {
         *               var str = from a2 in cntx.Admins
         *                         where a2.UserName == User
         *
         *                         select a2;
         *
         *               Admin A = str.First();
         *
         *               add.UNAME = A.UserName;
         *               add.PASS = A.Password;
         *
         *           }
         *
         *
         *           if (b == 1)
         *           {
         *               var str = from a2 in cntx.Managers
         *                         where a2.UserName == User
         *
         *                         select a2;
         *
         *                Manager M = str.First();
         *
         *               add.UNAME = M.UserName;
         *               add.PASS = M.Password;
         *
         *           }
         *
         *           if (b == 2)
         *           {
         *               var str = from a2 in cntx.Persons
         *                         where a2.UserName == User
         *
         *                         select a2;
         *
         *               Person p = str.First();
         *
         *               add.UNAME = p.UserName;
         *               add.PASS = p.Password;
         *               add.FNAME = p.FirstName;
         *               add.MNAME = p.MiddleName;
         *               add.LNAME = p.LastName;
         *               add.DOB = p.BirthDate;
         *               add.ADDRESS = p.Address;
         *
         *               add.EMAIL = p.Email;
         *               add.GENDER = p.Gender;
         *               add.ID = p.Id;
         *
         *
         *              //foreach(string k in flightlist)
         *               var st = from a3 in cntx.Flights
         *
         *                        select new { Flightlist =a3 };
         *
         *
         *
         *           }
         *
         *
         *           cntx.Dispose();
         *
         *   }
         *
         *
         */



        public void AddFlight(string flight, string dtime, string ddate, string route, FlightList F)
        {
            MydbDataContext cntx = new MydbDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Oyan Computer\Desktop\Project\Project\Forms\Mydb.mdf;Integrated Security=True");
            Flight          fl   = new Flight();

            cntx.Flights.InsertOnSubmit(fl);

            fl.Flight_Name    = flight;
            fl.Departure_Time = dtime;
            fl.Departure_Date = ddate;
            // fl.Route = route;

            cntx.Dispose();
            //  new ManagerList().ErrorMassage("New Flight Added");
        }