public Form1(TAIKHOAN user) { InitializeComponent(); User = user; this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); loadAllRoom(); //timer1.Start(); LoadDateTimePickerBill(); btnStatistics.PerformClick(); }
private void btnLogin_Click(object sender, EventArgs e) { string username = txtUserName.Text; string password = txtPassWord.Text; TAIKHOAN user = db.TAIKHOANs.Where(p => p.TENDANGNHAP == username && p.MATKHAU == password).FirstOrDefault(); if (user != null) { this.Hide(); Form1 f = new Form1(user); f.ShowDialog(); this.Close(); } else { MessageBox.Show("Tên tài khoản hoặc mật khẩu không đúng !"); } }