示例#1
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            using (BookCenterDBEntities1 db = new BookCenterDBEntities1())
            {
                if (db.TBLUserLog.Any(x => x.Username == textUsername.Text && x.Password == textPassword.Text))
                {
                    var UserData = db.TBLUserLog
                                   .Where(x => x.Username == textUsername.Text && x.Password == textPassword.Text)
                                   .FirstOrDefault();

                    Properties.Settings.Default.UserAutho = UserData.Authorize;
                    Properties.Settings.Default.Save();
                    BookStorageHome bookStorageHome = new BookStorageHome();
                    bookStorageHome.Show();
                    this.Hide();
                }
                else
                {
                    textUsername.BackColor = Color.Firebrick;
                    textUsername.ForeColor = Color.AliceBlue;
                    textPassword.BackColor = Color.Firebrick;
                    textPassword.ForeColor = Color.AliceBlue;
                    MessageBox.Show("Giriş İşlemi Başarısız. Tekrar Deneyin");
                }
            }
        }
示例#2
0
        private void UpdateHomaPage()
        {
            BookStorageHome page = (BookStorageHome)Application.OpenForms["BookStorageHome"];

            if (page != null)
            {
                page.studentDataFill();
            }
        }