private void lst_personellerim_SelectedIndexChanged(object sender, EventArgs e) { ListBox Lst = (ListBox)sender; Personel LstPersonel = (Personel)Lst.SelectedItem; Personel DatabasePersonel = BLL.Personel_KayitGetir(LstPersonel.PersonelID); if (DatabasePersonel != null) { txt_gisim.Text = DatabasePersonel.Isim; txt_gsoyisim.Text = DatabasePersonel.Soyisim; txt_gemail.Text = DatabasePersonel.EmailAdres; txt_gtelefon.Text = DatabasePersonel.Telefon; } }
internal int PersonelYeniKayit(Guid personelid, string isim, string soyisim, string email, string telefon) { if (personelid != Guid.Empty && !string.IsNullOrEmpty(isim) && !string.IsNullOrEmpty(soyisim)) { Personel P1 = new Personel(); P1.PersonelID = personelid; P1.Isim = isim; P1.Soyisim = soyisim; P1.EmailAdres = email; P1.Telefon = telefon; return(DAL.PersonelYeniKayit(P1)); } else { return(-100); //Eksik bilgi } }
internal int PersonelYeniKayit(Personel P) { try { command = new SqlCommand("sp_PersonelEkle", connect); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@PersonelID", SqlDbType.UniqueIdentifier).Value = P.PersonelID; command.Parameters.Add("@Isim", SqlDbType.NVarChar).Value = P.Isim; command.Parameters.Add("@Soyisim", SqlDbType.NVarChar).Value = P.Soyisim; command.Parameters.Add("@EmailAdres", SqlDbType.NVarChar).Value = P.EmailAdres; command.Parameters.Add("@Telefon", SqlDbType.NVarChar).Value = P.Telefon; BaglantiAyarla(); sonuc = command.ExecuteNonQuery(); //Insert-Update-Delete için executenonquery kullanılır } catch (Exception) { //LOG } finally { BaglantiAyarla(); } return(sonuc); }
internal int Personel_KayitGuncelle(Personel P) { try { command = new SqlCommand("SP_PersonelDüzenle", connect); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@PersonelID", SqlDbType.UniqueIdentifier).Value = P.PersonelID; command.Parameters.Add("@Isim", SqlDbType.NVarChar).Value = P.Isim; command.Parameters.Add("@Soyisim", SqlDbType.NVarChar).Value = P.Soyisim; command.Parameters.Add("@EmailAdres", SqlDbType.NVarChar).Value = P.EmailAdres; command.Parameters.Add("@Telefon", SqlDbType.NVarChar).Value = P.Telefon; BaglantiAyarla(); sonuc = command.ExecuteNonQuery(); } catch (Exception) { //Log } finally { BaglantiAyarla(); } return(sonuc); }