예제 #1
0
        public bool HastaSil(Hastalar h)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update Hastalar set  silindi=1  where hastaID=@hastaID", conn);

            comm.Parameters.Add("@hastaID", SqlDbType.Int).Value = h._hastaID;

            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 bool KisiEkle(Hastalar h)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Insert into Hastalar(ad,soyad,tcKimlikNo,adres,ilce,il,evTel,cepTel,kanGrubu,babaAd,anneAd,dogumYeri,dogumTarihi,cinsiyet,medeniHali,oncekiSoyad,vergiNo,kayitTarihi,kurumID) values(@ad,@soyad,@tcKimlikNo,@adres,@ilce,@il,@evTel,@cepTel,@kanGrubu,@babaAd,@anneAd,@dogumYeri,@dogumTarihi,@cinsiyet,@medeniHali,@oncekiSoyad,@vergiNo,@kayitTarihi,@kurumID)", conn);

            comm.Parameters.Add("@ad", SqlDbType.VarChar).Value           = h._ad;
            comm.Parameters.Add("@soyad", SqlDbType.VarChar).Value        = h._soyad;
            comm.Parameters.Add("@tcKimlikNo", SqlDbType.VarChar).Value   = h._tcKimlikNo;
            comm.Parameters.Add("@adres", SqlDbType.VarChar).Value        = h._adres;
            comm.Parameters.Add("@ilce", SqlDbType.VarChar).Value         = h._ilce;
            comm.Parameters.Add("@il", SqlDbType.VarChar).Value           = h._il;
            comm.Parameters.Add("@evTel", SqlDbType.VarChar).Value        = h._evTel;
            comm.Parameters.Add("@cepTel", SqlDbType.VarChar).Value       = h._cepTel;
            comm.Parameters.Add("@kanGrubu", SqlDbType.VarChar).Value     = h._kanGrubu;
            comm.Parameters.Add("@babaAd", SqlDbType.VarChar).Value       = h._babaAd;
            comm.Parameters.Add("@anneAd", SqlDbType.VarChar).Value       = h._anneAd;
            comm.Parameters.Add("@dogumYeri", SqlDbType.VarChar).Value    = h._dogumYeri;
            comm.Parameters.Add("@dogumTarihi", SqlDbType.DateTime).Value = h._dogumTarihi;
            comm.Parameters.Add("@cinsiyet", SqlDbType.VarChar).Value     = h._cinsiyet;
            comm.Parameters.Add("@medeniHali", SqlDbType.VarChar).Value   = h._medeniHali;
            comm.Parameters.Add("@oncekiSoyad", SqlDbType.VarChar).Value  = h._oncekiSoyad;
            comm.Parameters.Add("@vergiNo", SqlDbType.VarChar).Value      = h._vergiNo;
            comm.Parameters.Add("@kayitTarihi", SqlDbType.DateTime).Value = h._kayitTarihi;
            comm.Parameters.Add("@kurumID", SqlDbType.Int).Value          = h._kurumID;


            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);
        }