54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|