Beispiel #1
0
        public bool PersonelSil(Personeller p)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update Personeller set  silindi=1  where personelID=@personelID", conn);

            comm.Parameters.Add("@personelID", SqlDbType.Int).Value = p._personelID;

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }

            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                conn.Close();
            }


            return(Sonuc);
        }
Beispiel #2
0
        public void PersonelAdiGetir(ComboBox liste, string KlinikAd)
        {
            liste.Items.Clear();
            SqlCommand comm = new SqlCommand("Select ad,soyad from Personeller inner join Klinikler on Personeller.klinikID=Klinikler.klinikNo where Personeller.silindi=0 and unvanID=1 and Klinikler.klinikAd=@klinikAd ", conn);

            comm.Parameters.Add("@klinikAd", SqlDbType.VarChar).Value = KlinikAd;
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlDataReader dr = comm.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Personeller p = new Personeller();
                    p._ad    = dr["ad"].ToString();
                    p._soyad = dr["soyad"].ToString();

                    string HekimAd = p._ad + " " + p._soyad;



                    liste.Items.Add(HekimAd);
                }
            }
            dr.Close();
            conn.Close();
        }
Beispiel #3
0
        public Personeller PersonelBilgileriGetir(string KullaniciAdi, string Sifre)
        {
            Personeller p    = new Personeller();
            SqlCommand  comm = new SqlCommand("select * from Personeller where kullaniciAdi=@kullaniciAdi and sifre=@sifre", conn);

            comm.Parameters.Add("@kullaniciAdi", SqlDbType.VarChar).Value = KullaniciAdi;
            comm.Parameters.Add("@sifre", SqlDbType.VarChar).Value        = Sifre;


            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlDataReader dr;

            try
            {
                dr = comm.ExecuteReader();

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        p._personelID  = Convert.ToInt32(dr[0]);
                        p._sicilNo     = Convert.ToInt32(dr[1]);
                        p._unvanID     = Convert.ToInt32(dr[2]);
                        p._klinikID    = Convert.ToInt32(dr[3]);
                        p._ad          = dr[4].ToString();
                        p._soyad       = dr[5].ToString();
                        p._diplomaNo   = Convert.ToInt32(dr[6]);
                        p._adres       = dr[7].ToString();
                        p._evTel       = dr[8].ToString();
                        p._cepTel      = dr[9].ToString();
                        p._dogumTarihi = Convert.ToDateTime(dr[10]);
                        p._dogumYeri   = dr[11].ToString();
                    }
                    dr.Close();
                }
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                conn.Close();
            }

            return(p);
        }
Beispiel #4
0
        public bool PersonelGuncelle(Personeller p)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update Personeller set sicilNo=@sicilNo,unvanID=@unvanID,klinikID=@klinikID,ad=@ad,soyad=@soyad,diplomaNo=@diplomaNo,adres=@adres,evTel=@evTel,cepTel=@cepTel,dogumYeri=@dogumYeri,dogumTarihi=@dogumTarihi,kullaniciAdi=@kullaniciAdi,sifre=@sifre where personelID=@personelID", conn);

            comm.Parameters.Add("@sicilNo", SqlDbType.Int).Value    = p._sicilNo;
            comm.Parameters.Add("@unvanID", SqlDbType.Int).Value    = p._unvanID;
            comm.Parameters.Add("@klinikID", SqlDbType.Int).Value   = p._klinikID;
            comm.Parameters.Add("@ad", SqlDbType.VarChar).Value     = p._ad;
            comm.Parameters.Add("@soyad", SqlDbType.VarChar).Value  = p._soyad;
            comm.Parameters.Add("@diplomaNo", SqlDbType.Int).Value  = p._diplomaNo;
            comm.Parameters.Add("@adres", SqlDbType.VarChar).Value  = p._adres;
            comm.Parameters.Add("@evTel", SqlDbType.VarChar).Value  = p._evTel;
            comm.Parameters.Add("@cepTel", SqlDbType.VarChar).Value = p._cepTel;

            comm.Parameters.Add("@dogumYeri", SqlDbType.VarChar).Value    = p._dogumYeri;
            comm.Parameters.Add("@dogumTarihi", SqlDbType.DateTime).Value = p._dogumTarihi;
            comm.Parameters.Add("@kullaniciAdi", SqlDbType.VarChar).Value = p._kullaniciAdi;
            comm.Parameters.Add("@sifre", SqlDbType.VarChar).Value        = p._sifre;
            comm.Parameters.Add("@personelID", SqlDbType.Int).Value       = p._personelID;



            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery()); //Hata verip vermediği kontrol edilir.
            }
            catch (SqlException ex)                                //Hatayla karşılaşılması durumunda bu blok çalışır.
            {
                string hata = ex.Message;
            }
            finally { conn.Close(); }  //Hata olsun yada olmasın mutlaka çalışır.
            return(Sonuc);
        }
Beispiel #5
0
        public bool KisiEkle(Personeller p)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Insert into Personeller(sicilNo,unvanID,klinikID,ad,soyad,diplomaNo,adres,evTel,cepTel,dogumYeri,dogumTarihi,kullaniciAdi,sifre) values(@sicilNo,@unvanID,@klinikID,@ad,@soyad,@diplomaNo,@adres,@evTel,@cepTel,@dogumYeri,@dogumTarihi,@kullaniciAdi,@sifre)", conn);

            comm.Parameters.Add("@sicilNo", SqlDbType.Int).Value    = p._sicilNo;
            comm.Parameters.Add("@unvanID", SqlDbType.Int).Value    = p._unvanID;
            comm.Parameters.Add("@klinikID", SqlDbType.Int).Value   = p._klinikID;
            comm.Parameters.Add("@ad", SqlDbType.VarChar).Value     = p._ad;
            comm.Parameters.Add("@soyad", SqlDbType.VarChar).Value  = p._soyad;
            comm.Parameters.Add("@diplomaNo", SqlDbType.Int).Value  = p._diplomaNo;
            comm.Parameters.Add("@adres", SqlDbType.VarChar).Value  = p._adres;
            comm.Parameters.Add("@evTel", SqlDbType.VarChar).Value  = p._evTel;
            comm.Parameters.Add("@cepTel", SqlDbType.VarChar).Value = p._cepTel;

            comm.Parameters.Add("@dogumYeri", SqlDbType.VarChar).Value    = p._dogumYeri;
            comm.Parameters.Add("@dogumTarihi", SqlDbType.DateTime).Value = p._dogumTarihi;
            comm.Parameters.Add("@kullaniciAdi", SqlDbType.VarChar).Value = p._kullaniciAdi;
            comm.Parameters.Add("@sifre", SqlDbType.VarChar).Value        = p._sifre;



            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            try
            {
                Sonuc = Convert.ToBoolean(comm.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally { conn.Close(); }
            return(Sonuc);
        }