This commit is contained in:
2025-08-11 11:51:35 +03:00
parent 5c7bb2c399
commit 663784484e
8 changed files with 341 additions and 17 deletions

View File

@@ -3,6 +3,8 @@ using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Buffers;
using System.Resources;
using DugunSalonu.Properties;
namespace DugunSalonu
{
@@ -10,12 +12,23 @@ namespace DugunSalonu
{
public FrmLogin()
{
InitializeComponent();
}
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool ReleaseCapture();
private void FrmLogin_Load(object sender, EventArgs e)
{
}
private void btnVazgec_Click(object sender, EventArgs e)
@@ -25,6 +38,7 @@ namespace DugunSalonu
private async void btnGiris_Click(object sender, EventArgs e)
{
try
{
using (dugunsalonuContext db = new dugunsalonuContext())
@@ -32,11 +46,13 @@ namespace DugunSalonu
var user = await db.kullanici.Where(k => k.kullaniciadi == txtKullanici.Text && k.aktif == true && k.parola == txtSifre.Text).FirstOrDefaultAsync();
if (user != null)
{
btnGiris.BackgroundImage = Resources.loginAcik;
Task.Delay(2000).Wait();
FrmAddKullanici f1 = new FrmAddKullanici();
f1.Show();
this.Hide();
}
else { MessageBox.Show("Hatal<61> kullan<61>c<EFBFBD> bilgileri.","Hata"); }
else { MessageBox.Show("Hatal<61> kullan<61>c<EFBFBD> bilgileri.", "Hata"); }
//Kullanici girisKullanicisi = await db.Kullanici.Where(k => k.KullaniciAdi == txtKullanici.Text && k.Parola == txtSifre.Text).FirstOrDefaultAsync();
}
}
@@ -46,6 +62,20 @@ namespace DugunSalonu
throw;
}
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void pnlTop_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
}
}