Exemplo n.º 1
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            AirLineDbEntities1 db = new AirLineDbEntities1();
            var items             = db.Cust_Details.Where(a => a.Name.Equals(textBox1.Text)).ToList();

            dataGridView2.DataSource = items;
        }
Exemplo n.º 2
0
        private void logbtn_Click(object sender, EventArgs e)
        {
            AirLineDbEntities1 db = new AirLineDbEntities1();

            if (txtuser.Text != string.Empty && txtpass.Text != string.Empty)
            {
                var user = db.Admins.Where(a => a.UserName.Equals(txtuser.Text)).SingleOrDefault();
                if (user != null)
                {
                    if (user.Password.Equals(txtpass.Text))
                    {
                        MessageBox.Show("Succeed Login");
                    }
                    else
                    {
                        MessageBox.Show("Wrong Password!");
                    }
                }
                else
                {
                    MessageBox.Show("Wrong User name");
                }
            }
            else
            {
                MessageBox.Show("Please fill User Name & Password!");
            }
        }
Exemplo n.º 3
0
        private void Search_Cust_Load(object sender, EventArgs e)
        {
            AirLineDbEntities1 db = new AirLineDbEntities1();
            var items             = db.Cust_Details.ToList();

            dataGridView2.DataSource = items;
        }
Exemplo n.º 4
0
 public Ticket_Reservation()
 {
     InitializeComponent();
     db = new AirLineDbEntities1();
     BindSource();
     BindDestination();
 }
Exemplo n.º 5
0
        private void button3_Click(object sender, EventArgs e)
        {
            db = new AirLineDbEntities1();
            Cust_Details customer = db.Cust_Details.Where(a => a.Id == id).FirstOrDefault();

            customer.Name        = nametxt.Text;
            customer.LastName    = lastnametxt.Text;
            customer.Address     = addresstxt.Text;
            customer.PhoneNumber = phonenumtxt.Text;
            customer.Email       = emailtxt.Text;
            customer.BirthDate   = datebirthtxt.Value;
            db.SaveChanges();
            MessageBox.Show("Record Updated");
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            AirLineDbEntities1 db        = new AirLineDbEntities1();
            Cust_Details       customers = new Cust_Details
            {
                Name        = nametxt.Text,
                LastName    = lastnametxt.Text,
                Address     = addresstxt.Text,
                PhoneNumber = phonenumtxt.Text,
                Email       = emailtxt.Text,
                BirthDate   = datebirthtxt.Value
            };

            db.Cust_Details.Add(customers);
            db.SaveChanges();
            MessageBox.Show("Add one customer");
        }
Exemplo n.º 7
0
 public Customers(int?Id)
 {
     InitializeComponent();
     if (Id != null)
     {
         button1.Visible = false;
         db = new AirLineDbEntities1();
         Cust_Details customer = db.Cust_Details.Where(a => a.Id == Id).FirstOrDefault();
         id                 = customer.Id;
         nametxt.Text       = customer.Name;
         lastnametxt.Text   = customer.LastName;
         addresstxt.Text    = customer.Address;
         phonenumtxt.Text   = customer.PhoneNumber;
         emailtxt.Text      = customer.Email;
         datebirthtxt.Value = (DateTime)customer.BirthDate;
     }
     else
     {
         button3.Visible = false;
     }
 }
Exemplo n.º 8
0
 public Flight_Details()
 {
     InitializeComponent();
     db = new AirLineDbEntities1();
 }