예제 #1
0
        public bool KlinikSil(Klinikler k)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update Klinikler set silindi=1 where klinikNo=@klinikNo ", conn);

            comm.Parameters.Add("@klinikNo", SqlDbType.Int).Value = k._klinikNo;

            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);
        }
예제 #2
0
        public void KlinikAdiGetir(ComboBox liste)
        {
            liste.Items.Clear();
            SqlCommand comm = new SqlCommand("Select * from Klinikler where silindi=0", conn);

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

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Klinikler k = new Klinikler();
                    k._klinikNo = Convert.ToInt32(dr["klinikNo"]);
                    k._klinikAd = dr["klinikAd"].ToString();


                    liste.Items.Add(k);
                }
            }
            dr.Close();
            conn.Close();
        }
예제 #3
0
        public bool KlinikDuzenle(Klinikler k)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update Klinikler set klinikAd =@klinikAd,randevuSure=@randevuSure,aciklama=@aciklama where klinikNo=@klinikNo", conn);

            comm.Parameters.Add("@klinikAd", SqlDbType.VarChar).Value = k._klinikAd;
            comm.Parameters.Add("@klinikNo", SqlDbType.Int).Value     = k._klinikNo;
            comm.Parameters.Add("@randevuSure", SqlDbType.Int).Value  = k._randevuSure;
            comm.Parameters.Add("@aciklama", SqlDbType.VarChar).Value = k._aciklama;
            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);
        }