private void tsGuncelle_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtPersonelAd.Text) && !string.IsNullOrEmpty(txtTC.Text)) { Personnel degisen = pr.GetPersonnelById(ID); degisen.PersonName = txtPersonelAd.Text; degisen.PersonSurname = txtPersonelSoyad.Text; degisen.IdentificationNo = txtTC.Text; if (rbAdmin.Checked) { degisen.Admin = true; } else { degisen.Admin = false; } degisen.Phone = mtxtTel.Text; degisen.Adress = txtAdres.Text; degisen.Uname = txtUsername.Text; degisen.Upwd = txtPasword.Text; degisen.JobName = txtUnvan.Text; degisen.Salary = Convert.ToDecimal(txtMaas.Text); degisen.Status = true; if (pr.PersonnelControlFromUpdate(degisen)) { MessageBox.Show("Bu personel kayıtlı!", "Tekrar kayıt yapılamaz !"); } else { if (pr.UpdatePersonnel(degisen)) { MessageBox.Show("Personel bilgileri değiştirildi.", "Update gerçekleşti."); GridDuzenle(pr.GetPersonnels()); Temizle(); } } } else { MessageBox.Show("Personel girilmelidir!", "Dikkat! Eksik Bilgi!", MessageBoxButtons.OK, MessageBoxIcon.Information); } txtPersonelAd.Focus(); }
public void UpdatePersonnel(Personnel personnel) { personnelRepository.UpdatePersonnel(personnel); }