public static List <EntityPersonel> PersonelListesi() { List <EntityPersonel> degerler = new List <EntityPersonel>(); SqlCommand komut1 = new SqlCommand("Select * From Tbl_Bilgi", Baglanti.bgl); if (komut1.Connection.State != ConnectionState.Open) { komut1.Connection.Open(); } SqlDataReader dr = komut1.ExecuteReader(); while (dr.Read()) { EntityPersonel ent = new EntityPersonel(); ent.Id = int.Parse(dr["ID"].ToString()); ent.Ad = dr["AD"].ToString(); ent.Soyad = dr["SOYAD"].ToString(); ent.Gorev = dr["GOREV"].ToString(); ent.Sehir = dr["SEHİR"].ToString(); ent.Maas = short.Parse(dr["MAAS"].ToString()); degerler.Add(ent); } dr.Close(); return(degerler); }
private void BtnSil_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Id = Convert.ToInt32(TxtId.Text); LogicPersonel.LLPersonelSil(ent.Id); }
public static List <EntityPersonel> PersonelListesi() { List <EntityPersonel> degerler = new List <EntityPersonel>(); SqlCommand komut = new SqlCommand("DEPARTMANLISTESI", Baglanti.bgl); komut.CommandType = CommandType.StoredProcedure; if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } SqlDataReader dr = komut.ExecuteReader(); while (dr.Read()) { EntityPersonel ent = new EntityPersonel(); ent.Personelid = Convert.ToInt32(dr["PERSONELID"].ToString()); ent.Personelad = dr["PERSONELAD"].ToString(); ent.Personelsoyad = dr["PERSONELSOYAD"].ToString(); ent.Personelmaas = Convert.ToDecimal(dr["PERSONELMAAS"].ToString()); // ent.Personeldepartman = Convert.ToByte(dr["PERSONELDEPARTMAN"].ToString()); ent.Personeldep = dr["DEPARTMANAD"].ToString(); ent.Personelfotograf = dr["PERSONELFOTOGRAF"].ToString(); degerler.Add(ent); } dr.Close(); return(degerler); }
public static List <EntityPersonel> PersonelListesi() { List <EntityPersonel> degerler = new List <EntityPersonel>(); SqlCommand komut1 = new SqlCommand("SELECT * FROM TBLBILGI", Baglanti.bgl); if (komut1.Connection.State != ConnectionState.Open) { komut1.Connection.Open(); } SqlDataReader dr = komut1.ExecuteReader(); while (dr.Read()) { EntityPersonel ent = new EntityPersonel(); ent.Id = int.Parse(dr["ID"].ToString()); ent.Ad = dr["AD"].ToString(); ent.Soyad = dr["SOYAD"].ToString(); ent.Sehir = dr["SEHIR"].ToString(); ent.Gorev = dr["GOREV"].ToString(); ent.Maas = short.Parse(dr["MAAS"].ToString()); degerler.Add(ent); //--Değerlerin içerisine ekle neyi? ent'den gelecek olan değerleri-- } dr.Close(); return(degerler); }
public static List <EntityPersonel> PersonelListesi() { List <EntityPersonel> degerler = new List <EntityPersonel>(); SqlCommand komut = new SqlCommand("DEPARTMANLISTELE", Baglanti.baglanti); komut.CommandType = CommandType.StoredProcedure; if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } SqlDataReader dr = komut.ExecuteReader(); while (dr.Read()) { EntityPersonel ent = new EntityPersonel(); ent.PersonelId = int.Parse(dr["PERSONELID"].ToString()); ent.PersonelAd = dr["PERSONELAD"].ToString(); ent.PersonelSoyad = dr["PERSONELSOYAD"].ToString(); ent.PersonelMaas = decimal.Parse(dr["PERSONELMAAS"].ToString()); ent.PersonelDepartmanAd = dr["DEPARTMANAD"].ToString(); ent.PersonelFotograf = dr["PERSONELFOTOGRAF"].ToString(); degerler.Add(ent); } dr.Close(); return(degerler); }
private void btnsil_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Id = Convert.ToInt32(txtid.Text); LogicPersonel.LLPersonelSil(ent.Id); MessageBox.Show("Personel Silindi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
private void btnSil_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Id = int.Parse(txtID.Text); LogicPersonel.PersonelSil(ent.Id); Listele(); Temizle(); }
protected void Button1_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Personelad = TextBox1.Text; ent.Personelsoyad = TextBox2.Text; ent.Personelmaas = decimal.Parse(TextBox3.Text); ent.Personeldepartman = byte.Parse(DropDownList1.SelectedValue); BLLPersonel.BLLPersonelEkle(ent); }
private void BtnEkle_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Ad = TxtAd.Text; ent.Soyad = TxtSoyad.Text; ent.Sehir = TxtSehir.Text; ent.Gorev = TxtGorev.Text; ent.Maas = short.Parse(TxtMaas.Text); LogicPersonel.LLPersonelEkle(ent); }
public static bool LLPersonelGuncelleme(EntityPersonel ent) { if (ent.Ad != "" && ent.Ad.Length <= 3 && ent.Soyad != "" && ent.Gorev != "" && ent.Sehir != "" && ent.Maas <= 1000) { return(DALPersonel.PersonelGuncelle(ent)); } else { return(false); } }
public static int BLLPersonelEkle(EntityPersonel m) { if (m.Personelad != "" && m.Personelsoyad != "" & m.Personeldepartman != 0) { return(DALPersonel.PersonelEkle(m)); } else { return(-1); } }
public static int LLPersonelEkle(EntityPersonel p) { if (p.Ad != "" && p.Soyad != "") { return(DALPersonel.PersonelEkle(p)); } else { return(-1); } }
public static int PersonelEkle(EntityPersonel personelDeger) { SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.InsertPersonelSorgu, Baglanti.connection); command.Parameters.AddWithValue(ResourcePersonel.Parameter1, personelDeger.PersonelAd); command.Parameters.AddWithValue(ResourcePersonel.Parameter2, personelDeger.PersonelSoyad); command.Parameters.AddWithValue(ResourcePersonel.Parameter3, personelDeger.PersonelDepartmanId); command.Parameters.AddWithValue(ResourcePersonel.Parameter4, personelDeger.PersonelMaas); return(command.ExecuteNonQuery()); }
public static int LLPersonelEkle(EntityPersonel p) { if (p.Ad != "" && p.Soyad != "" && p.Maas >= 3500 && p.Ad.Length >= 3) { return(DALPersonel.PersonelEkle(p)); } else { return(-1); } }
public static bool LLPersonelGuncelle(EntityPersonel ent) { if (ent.Ad != "" && ent.Soyad != "") { return(DALPersonel.PersonelGuncelle(ent)); } else { return(false); } }
public static int BLLPersonelEkle(EntityPersonel p) { if (p.Personelad != "" && p.Personelsoyad != "" && p.Personelmaas != 0) { return(DALPersonel.PersonelEkle(p)); } else { return(-1); } }
protected void Button1_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Personelad = TextBox1.Text; ent.Personelsoyad = TextBox2.Text; ent.Personelmaas = Convert.ToDecimal(TextBox3.Text); ent.Personeldepartman = Convert.ToByte(DropDownList1.SelectedValue); BLLPersonel.BLLPersonelEkle(ent); Response.Redirect("Personel.aspx"); }
public static bool LLPersonelGuncelle(EntityPersonel ent) { if (ent.Ad.Length >= 3 && ent.Ad != "" && ent.Maas >= 4200) { return(DALPersonel.PersonelGuncelle(ent)); } else { return(false); } }
private void BtnGuncelle_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Id = Convert.ToInt32(TxtId.Text); ent.Ad = TxtAd.Text; ent.Soyad = TxtSoyad.Text; ent.Sehir = TxtSehir.Text; ent.Gorev = TxtGorev.Text; ent.Maas = short.Parse(TxtMaas.Text); LogicPersonel.LLPersonelGuncelleme(ent); }
public static int PersonelGuncelle(EntityPersonel entityPersonel) { if (entityPersonel.PersonelAd != "" && entityPersonel.PersonelSoyad != "" && entityPersonel.PersonelDepartmanId > 0 && entityPersonel.PersonelMaas > 0) { return(DALPersonel.PersonelGuncelle(entityPersonel)); } return(-1); }
private void btnekle_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Ad = txtad.Text; ent.Soyad = txtsoyad.Text; ent.Sehir = txtsehir.Text; ent.Maas = short.Parse(txtmaas.Text); ent.Gorev = txtgorev.Text; LogicPersonel.LLPersonelEkle(ent); MessageBox.Show("Personel Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static int PersonelGuncelle(EntityPersonel personelDeger) { SqlCommand command = MyExtensions.CreateCommandAndOpenConnection(ResourcePersonel.UpdatePersonelSorgu, Baglanti.connection); command.Parameters.AddWithValue(ResourcePersonel.IdParameter, personelDeger.PersonelId); command.Parameters.AddWithValue(ResourcePersonel.AdParam, personelDeger.PersonelAd); command.Parameters.AddWithValue(ResourcePersonel.SoyadParam, personelDeger.PersonelSoyad); command.Parameters.AddWithValue(ResourcePersonel.DepartmanParam, personelDeger.PersonelDepartmanId); command.Parameters.AddWithValue(ResourcePersonel.MaasParam, personelDeger.PersonelMaas); return(command.ExecuteNonQuery()); }
private void btnEkle_Click(object sender, EventArgs e) { EntityPersonel ent = new EntityPersonel(); ent.Ad = txtAd.Text; ent.Soyad = txtSoyad.Text; ent.Gorev = txtGorev.Text; ent.Sehir = txtSehir.Text; ent.Maas = short.Parse(txtMaas.Text); LogicPersonel.PersonelEkle(ent); Listele(); Temizle(); }
protected void btnKaydet_Click(object sender, EventArgs e) { EntityPersonel entityPersonel = new EntityPersonel { PersonelAd = txtPersonelAd.Text, PersonelSoyad = txtPersonelSoyad.Text, PersonelMaas = Convert.ToDecimal(txtPersonelMaas.Text), PersonelDepartmanId = Convert.ToByte(cmbPersonelDepartman.SelectedValue) }; int sonuc = BLLPersonel.PersonelEkle(entityPersonel); MyPresentationExtensions.ShowErrorMessageOrRedirect(sonuc, ResourcePersonel.PersonellerSayfasi, ResourcePersonel.PersonelEkleError); }
public static int PersonelEkle(EntityPersonel p) { if (p.Ad != "" && p.Soyad != "" && p.Maas >= 3500 && p.Ad.Length >= 3) { MessageBox.Show("Kayıt Başarılı Bir Şekilde Gerçekleşti", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information); return(DALPersonel.PersonelEkle(p)); } else { MessageBox.Show("Lütfen Bilgileri Kontrol Ediniz", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(-1); } }
protected void Page_Load(object sender, EventArgs e) { EntityPersonel entityPersonel = BLLPersonel.PersonelGetirById(Convert.ToByte(Request.QueryString["id"])); if (Page.IsPostBack == false) { txtPersonelId.Text = entityPersonel.PersonelId.ToString(); txtPersonelAd.Text = entityPersonel.PersonelAd; txtPersonelSoyad.Text = entityPersonel.PersonelSoyad; txtPersonelMaas.Text = entityPersonel.PersonelMaas.ToString(); SetPersonelDepartmanToDropdown(entityPersonel); } }
public static bool PersonelGuncelle(EntityPersonel ent) { if (ent.Ad != "" && ent.Soyad != "" && ent.Maas >= 4500) { MessageBox.Show("Kayıt Başarılı Bir Şekilde Güncellendi", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information); return(DALPersonel.PersonelGuncelle(ent)); } else { MessageBox.Show("Lütfen Bilgileri Kontrol Ediniz", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } }
public static int PersonelEkle(EntityPersonel p) { SqlCommand komut4 = new SqlCommand("insert into TBLPERSONEL(PERSONELAD,PERSONELSOYAD,PERSONELDEPARTMAN,PERSONELMAAS) values (@P1,@P2,@P3,@P4)", Baglanti.bgl); if (komut4.Connection.State != ConnectionState.Open) { komut4.Connection.Open(); } komut4.Parameters.AddWithValue("@P1", p.Personelad); komut4.Parameters.AddWithValue("@P2", p.Personelsoyad); komut4.Parameters.AddWithValue("@P3", p.Personeldepartman); komut4.Parameters.AddWithValue("@P4", p.Personelmaas); return(komut4.ExecuteNonQuery()); }
private void SetPersonelDepartmanToDropdown(EntityPersonel entityPersonel) { if (cmbPersonelDepartman.Items.Count == 0) { List <EntityDepartman> departmanList = BLLDepartman.BLLDepartmanListele(); foreach (var item in departmanList) { cmbPersonelDepartman.Items.Add(new ListItem(item.DepartmanAd, item.DepartmanId.ToString())); } cmbPersonelDepartman.SelectedValue = entityPersonel.PersonelDepartmanId.ToString(); } }
public static int PersonelEkle(EntityPersonel p) { SqlCommand komut2 = new SqlCommand("insert into TBLBILGI (AD,SOYAD,GOREV,SEHIR,MAAS) VALUES (@p1,@p2,@p3,@p4,@p5)", Baglanti.bgl); if (komut2.Connection.State != ConnectionState.Open) { komut2.Connection.Open(); } komut2.Parameters.AddWithValue("@p1", p.Ad); komut2.Parameters.AddWithValue("@p2", p.Soyad); komut2.Parameters.AddWithValue("@p3", p.Gorev); komut2.Parameters.AddWithValue("@p4", p.Sehir); komut2.Parameters.AddWithValue("@p5", p.Maas); return(komut2.ExecuteNonQuery()); }