コード例 #1
0
        public List <Personel> SelectPersonelSorgu(string inSorgu)
        {
            con.Open();
            List <Personel> personeller = new List <Personel>();
            SqlCommand      cmd         = new SqlCommand(inSorgu, con);
            SqlDataReader   dr;

            dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                Insan insan = new Insan()
                {
                    ad          = dr[1].ToString(),
                    tc          = dr[0].ToString(),
                    soyad       = dr[2].ToString(),
                    dogumTarihi = (DateTime)dr[3],
                    dogumYeri   = dr[4].ToString(),
                    cinsiyet    = (Boolean)dr[5]
                };
                Firma firma = new Firma()
                {
                    ad = dr[9].ToString()
                };

                Personel personel = new Personel(insan, firma)
                {
                    maas    = float.Parse(dr[6].ToString()),
                    vardiya = dr[7].ToString(),
                    gorevi  = dr[8].ToString()
                };
                personeller.Add(personel);
            }
            dr.Close();
            cmd.ExecuteNonQuery();
            con.Close();
            cmd.Dispose();
            return(personeller);
        }
コード例 #2
0
 public void PersonelGuncelle(Personel inPersonel, Firma inFirma)
 {
     ////PersonelIDGetir(inPersonel.ID);
     //Sorgu("update Personel set Maas='" + inPersonel.maas + "',Vardiya='" + inPersonel.vardiya + "',Gorev='" + inPersonel.gorevi + "',InsanID='" + InsanIDGetir(inPersonel.insan.tc) + "',FirmaID='" + FirmaIDGetir(inFirma.ad) + "' where InsanID=" + InsanIDGetir(inPersonel.insan.tc) + "");
 }
コード例 #3
0
 public void PersonelGuncelle(Personel inPersonel)
 {
     //Güncelle kısmı c*k kötü oldu araştır.
     Sorgu("update Personel set Maas=" + inPersonel.maas + ",Vardiya='" + inPersonel.vardiya + "',Gorev='" + inPersonel.gorevi + "',InsanID=" + inPersonel.insan.ID + ",FirmaID=" + inPersonel.firma.ID + "  where InsanID=" + inPersonel.insan.ID + "");
     //Sorgu("update Insan set Ad='" + inPersonel.insan.ad + "',Soyad='" + inPersonel.insan.soyad + "',Tc='" + inPersonel.insan.tc + "',DogumTarihi='" + Convert.ToDateTime(inPersonel.insan.dogumTarihi) + "',DogumYeri='" + inPersonel.insan.dogumYeri + "',Cinsiyet='" + inPersonel.insan.cinsiyet + "'  where ID=" + inPersonel.insan.ID + "");
 }