This commit is contained in:
2025-08-08 12:31:51 +03:00
parent 3301e17f22
commit 4796beac49
29 changed files with 2369 additions and 77 deletions

57
FrmAddKullanici.cs Normal file
View File

@@ -0,0 +1,57 @@
using DugunSalonu.Models;
using System.Threading.Tasks;
namespace DugunSalonu
{
public partial class FrmAddKullanici : Form
{
public FrmAddKullanici()
{
InitializeComponent();
}
private async void btnEkle_Click(object sender, EventArgs e)
{
if (txtParola.Text != txtParolatekrar.Text)
{
MessageBox.Show("Parolalar eşleşmiyor.", "Hata");
return;
}
using (dugunsalonuContext db = new dugunsalonuContext())
{
await db.kullanici.AddAsync(new Kullanici
{
Adi = txtAdi.Text,
Soyadi = txtSoyadi.Text,
KullaniciAdi = txtKullaniciAdi.Text,
Parola = txtParola.Text,
Aktif = true,
Admin = false,
CepTel = txtCeptel.Text,
Eposta = txtEposta.Text
});
await db.SaveChangesAsync();
FormTemizle();
MessageBox.Show("İşlem başarılı", "Ekleme");
}
}
private void btnVazgec_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void FormTemizle()
{
foreach (TextBox item in this.Controls)
{
if (item is TextBox)
{
item.Clear();
}
}
}
}
}