private void Form1_Load(object sender, EventArgs e) { #region DBCreate using (var db = new UserDBContect()) { db.Database.EnsureCreated(); } using (var db = new OrderDBContect()) { db.Database.EnsureCreated(); } using (var db = new ReservationDBContect()) { db.Database.EnsureCreated(); } #endregion #region Subscribe signUp.SignUpClick += SignUp_SignUpClick; signIn.SignInClick += SignIn_SignInClick; menu.FoodsEvent += Menu_FoodsEvent; menu.ReserveEvent += Menu_ReserveEvent; menu.UserInfoEvent += Menu_UserInfoEvent; menu.AppInfoEvent += Menu_AppInfoEvent; #endregion }
protected void materialLabel3_Click(object sender, EventArgs e) { UserDBContect appDB = new UserDBContect(); try { User user = appDB.Users.FirstOrDefault(u => u.Email == emailbox.Text); SignInClick.Invoke(sender, e); Used.Email = emailbox.Text; } catch (Exception) { MessageBox.Show("Not Found"); return; } }