using DugunSalonu.Models; using Microsoft.EntityFrameworkCore; using System.Threading.Tasks; using System.Windows.Forms; using System.Buffers; namespace DugunSalonu { public partial class FrmLogin : Form { public FrmLogin() { InitializeComponent(); } private void FrmLogin_Load(object sender, EventArgs e) { } private void btnVazgec_Click(object sender, EventArgs e) { Application.Exit(); } private async void btnGiris_Click(object sender, EventArgs e) { try { using (dugunsalonuContext db = new dugunsalonuContext()) { var user = await db.kullanici.Where(k => k.KullaniciAdi == txtKullanici.Text && k.Aktif == true && k.Parola == txtSifre.Text).FirstOrDefaultAsync(); if (user != null) { FrmAddKullanici f1 = new FrmAddKullanici(); f1.Show(); this.Hide(); } else { MessageBox.Show("Hatalı kullanıcı bilgileri.","Hata"); } //Kullanici girisKullanicisi = await db.Kullanici.Where(k => k.KullaniciAdi == txtKullanici.Text && k.Parola == txtSifre.Text).FirstOrDefaultAsync(); } } catch (Exception) { throw; } } } }