private void profilimiDoldur() { profilimKullanici = new KullaniciRepo().IDYiGetir(FormSeferTasiGiris.kullanici.KullaniciId); txtProfilimFirmaAdı.Text = firma.FirmaAdi; txtProfilimAdres.Text = firma.Adres; txtProfilimTelefon.Text = firma.Telefon; txtProfilimKullaniciAdi.Text = profilimKullanici.KullaniciAdi; txtProfilimParola.Text = profilimKullanici.Parola; txtProfilimParolaTekrar.Text = profilimKullanici.Parola; txtProfilimEMail.Text = profilimKullanici.Email; }
private void btnAskıyaAl_Click(object sender, EventArgs e) { if (lstFirmalar.SelectedItem == null) { return; } seciliFirma = new FirmaRepo().IDYiGetir((lstFirmalar.SelectedItem as Firma).FirmaId); seciliFirma.FirmaAktifMi = false; Kullanici seciliKullanici = new KullaniciRepo().HepsiniGetir().Where(x => x.KullaniciId == seciliFirma.KullaniciId).FirstOrDefault(); seciliKullanici.KullaniciAktifMi = false; new FirmaRepo().Guncelle(); new KullaniciRepo().Guncelle(); firmaButonAyarla(); FirmaListesiGuncelle(); }
private void btnUyelikIptal_Click(object sender, EventArgs e) { Musteri seciliMusteri = new MusteriRepo().HepsiniGetir().Where(x => x.MusteriId == musteri.MusteriId).FirstOrDefault(); seciliMusteri.MusteriAktifMi = false; using (var tran = db.Database.BeginTransaction()) { new MusteriRepo().Guncelle(); Kullanici seciliKullanici = new KullaniciRepo().HepsiniGetir().Where(x => x.KullaniciId == seciliMusteri.KullaniciId).FirstOrDefault(); seciliKullanici.KullaniciAktifMi = false; new KullaniciRepo().Guncelle(); MessageBox.Show("Üyeliğiniz İptal Edilmiştir !"); this.Dispose(); } this.Dispose(); }
private void btnFirmaKaydet_Click(object sender, EventArgs e) { Kullanici yeniKullanici = new Kullanici() { KullaniciAdi = txtFirmaKullaniciAdi.Text, Parola = txtFirmaParola.Text, Email = txtFirmaMail.Text, KullaniciAktifMi = false, RolId = 2 }; using (var tran = db.Database.BeginTransaction()) { try { new KullaniciRepo().Ekle(yeniKullanici); Kullanici sonKullanici = new KullaniciRepo().HepsiniGetir().LastOrDefault(); new FirmaRepo().Ekle(new Firma() { FirmaAdi = txtFirmaAdi.Text, FirmaAktifMi = false, Adres = txtFirmaAdres.Text, Telefon = txtFirmaTelefon.Text, MinTeslimSuresi = 30, KullaniciId = sonKullanici.KullaniciId }); MessageBox.Show("Kayıt Başarılı"); } catch (Exception) { MessageBox.Show("Kayıt Başarısız"); } finally { formuTemizle(groupBox1); formuTemizle(groupBox2); } } }