Exemplo n.º 1
0
 private void GateLogForm_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'vtdi_gatelog_dbDataSet2.VehicleType' table. You can move, or remove it, as needed.
     this.vehicleTypeTableAdapter.Fill(this.vtdi_gatelog_dbDataSet2.VehicleType);
     // TODO: This line of code loads data into the 'vtdi_gatelog_dbDataSet1.Itemtodeclear' table. You can move, or remove it, as needed.
     this.itemtodeclearTableAdapter.Fill(this.vtdi_gatelog_dbDataSet1.Itemtodeclear);
     // TODO: This line of code loads data into the 'vtdi_gatelog_dbDataSet.purpose' table. You can move, or remove it, as needed.
     this.purposeTableAdapter.Fill(this.vtdi_gatelog_dbDataSet.purpose);
     Ctx = new vtdi_gatelog_dbEntities1();
 }
Exemplo n.º 2
0
        private void BtSubmit_Click(object sender, EventArgs e)
        {
            LoginForm BtSubmit = new LoginForm();
            var       username = tbUsername.Text;
            var       password = tbPassword.Text;

            var Ctx  = new vtdi_gatelog_dbEntities1();
            var user = Ctx.Users.Any(q => q.UserName == username && q.Password == password);

            if (user)
            {
                MessageBox.Show($"Welcome {username}");
                var parent = (Form1)this.MdiParent;
                parent.isloggedin = true;
                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid credentials");
            }
        }