Exemple #1
0
        public bool HastaGecmisiEkle(HastaGecmisi hg)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Insert into HastaGecmisi(aciklama,hastaID) values(@aciklama,@hastaID)", conn);

            comm.Parameters.Add("@hastaID", SqlDbType.Int).Value      = hg._hastaID;
            comm.Parameters.Add("@aciklama", SqlDbType.VarChar).Value = hg._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);
        }
Exemple #2
0
        public bool HastaGecmisiDuzenle(HastaGecmisi hg)
        {
            bool       Sonuc = false;
            SqlCommand comm  = new SqlCommand("Update HastaGecmisi set aciklama=@aciklama where gecmisID=@gecmisID", conn);

            comm.Parameters.Add("@gecmisID", SqlDbType.Int).Value     = hg._gecmisID;
            comm.Parameters.Add("@aciklama", SqlDbType.VarChar).Value = hg._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);
        }