private void frmPersonelIslemleri_Load(object sender, EventArgs e) { Cpersonel cp = new Cpersonel(); CpersonelGorev cpg = new CpersonelGorev(); string gorev = cpg.personelGorevTanim(Cgenel._gorevId); cp.personelBilgileriniGetirLV(lwPersoneller); if (gorev == "Müdür") { cp.personelBilgileriniGetir(cbPersoneller); cpg.personelGorevGetir(cbGorevPersonel); /* btnYeniPersonel.Enabled = true; * btnPerGuncelle.Enabled = false; * groupBoxP1.Visible = true; * groupBoxP2.Visible = false; * groupBoxP3.Visible = false; * txtPerSifre.ReadOnly = true; * txtPerYeniSifre.ReadOnly = true;*/ labelPersonel.Text = "Mevki: Müdür / Kullanıcı:" + cp.perBilgiAdGetirT(Cgenel._personelId); } else { // groupBoxP1.Visible = false; // groupBoxP2.Visible = false; // groupBoxP3.Visible = true; labelPersonel.Text = "Mevki: Personel / Kullanıcı:" + cp.perBilgiAdGetirT(Cgenel._personelId); } }
private void btnPerGuncelle_Click(object sender, EventArgs e) { if (lwPersoneller.SelectedItems.Count > 0) //seçili listview varsa { if (txtPersonelAd.Text != "" || txtPersonelSoyad.Text != "" || txtPersonelSifre.Text != "" || txtGorevID.Text != "") { if (txtPersonelSifre.Text.Trim() == txtPersonelSifreT.Text.Trim()) { Cpersonel c = new Cpersonel(); c.PersonelAd = txtPersonelAd.Text.Trim(); c.PersonelSoyad = txtPersonelSoyad.Text.Trim(); c.PersonelParola = txtPersonelSifreT.Text; c.GorevId = Convert.ToInt32(txtGorevID.Text); bool sonuc = c.personelGuncelle(c, Convert.ToInt32(txtPersonelID.Text)); //??????????? if (sonuc) { MessageBox.Show("Kayıt başarı ile güncellenmiştir."); c.personelBilgileriniGetirLV(lwPersoneller); } else { MessageBox.Show("Kayıt güncellenemedi."); } } else { MessageBox.Show("Şifreler aynı değil..."); } } else { MessageBox.Show("Lütfen bütün alanları doldurunuz."); } } else { MessageBox.Show("Lütfen kayıt seçiniz !"); } }