示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (txttxtTelNo.Text.Length >= 11)
            {
                if (txthastaAd.Text == "" || txthastaSoyad.Text == "")
                {
                    MessageBox.Show("Lütfen Hasta Adı ve Soyadı giriniz");
                }
                else
                {
                    cHastalar c     = new cHastalar();
                    bool      sonuc = c.hastaVarMi(txttxtTelNo.Text);
                    if (!sonuc)
                    {
                        c.hastaKan      = "";
                        c.hastaCinsiyet = "";
                        c.hastaAdi      = txthastaAd.Text;
                        c.hastaSoyadi   = txthastaSoyad.Text;
                        c.hastaTC       = txthastaTC.Text;
                        c.hastaDG       = txthastaDG.Text;
                        c.hastaMeslek   = txthastaMeslek.Text;
                        if (txthastaKan.SelectedIndex > -1)
                        {
                            c.hastaKan = txthastaKan.SelectedItem.ToString();
                        }
                        c.hastaTel    = txttxtTelNo.Text;
                        c.hastaIl     = txthastaIl.Text;
                        c.hastaIlce   = txthastaIlce.Text;
                        c.hastaMh     = txthastaMahalle.Text;
                        c.hastaCd     = txthastaCadde.Text;
                        c.hastaAdres  = txthastaAdres.Text;
                        c.hastaBaba   = txthastaBaba.Text;
                        c.hastaAnne   = txthastaAnne.Text;
                        c.hastaDGyeri = txthastaDgyeri.Text;
                        if (txthastaCinsiyet.SelectedIndex > -1)
                        {
                            c.hastaCinsiyet = txthastaCinsiyet.SelectedItem.ToString();
                        }
                        c.hastaBoy      = txthastaBoy.Text;
                        c.hastaKilo     = txthastaKilo.Text;
                        c.hastaMail     = txthastaMail.Text;
                        c.hastaKasa     = txthastaKasa.Text;
                        txthastaid.Text = c.hastaEkle(c).ToString();

                        if (txthastaid.Text != "")
                        {
                            MessageBox.Show("Hasta Eklendi");
                        }
                        else
                        {
                            MessageBox.Show("Hasta Eklenemedi");
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Telefon No 11 haneli olmalıdır");
            }
        }
示例#2
0
 private void frmHastaEkleme_Load(object sender, EventArgs e)
 {
     if (cGenel._hastaID > 0)
     {
         cHastalar c = new cHastalar();
         txthastaid.Text = cGenel._hastaID.ToString();
         c.hastalariGetirID(Convert.ToInt32(txthastaid.Text), txthastaAd, txthastaSoyad, txttxtTelNo, txthastaAdres, txthastaMail);
     }
 }
示例#3
0
 private void frmHastaEkleme_Load(object sender, EventArgs e)
 {
     if (cGenel._hastaID > 0)
     {
         cHastalar c = new cHastalar();
         txthastaid.Text = cGenel._hastaID.ToString();
         c.hastalariGetirID(Convert.ToInt32(txthastaid.Text), txthastaAd, txthastaSoyad, txthastaTC, txthastaDG, txthastaMeslek, txthastaKan, txttxtTelNo, txthastaIl, txthastaIlce, txthastaMahalle, txthastaCadde, txthastaAdres, txthastaBaba, txthastaAnne, txthastaDgyeri, txthastaCinsiyet, txthastaBoy, txthastaKilo, txthastaMail, txthastaKasa);
     }
 }
示例#4
0
        public bool hastaBilgileriGuncelle(cHastalar h)
        {
            bool          sonuc = false;
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("Update hastalar set hastaAdi=@ad,hastaSoyadi=@soyad,hastaTC=@tc,hastaDG=@dg,hastaMeslek=@meslek,hastaKan=@kan,hastaTel=@tel,hastaIl=@il,hastaIlce=@ilce,hastaMh=@mh,hastaCd=@cd,hastaAdres=@adres,hastaBaba=@baba,hastaAnne=@anne,hastaDGyeri=@dgyeri,hastaCinsiyet=@cinsiyet,hastaBoy=@boy,hastaKilo=@kilo,hastaMail=@mail,hastaKasa=@kasa where hastaID = @id ", con);


            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.Parameters.Add("@ad", SqlDbType.VarChar).Value       = h._hastaAdi;
                cmd.Parameters.Add("@soyad", SqlDbType.VarChar).Value    = h._hastaSoyadi;
                cmd.Parameters.Add("@id", SqlDbType.VarChar).Value       = h._hastaId;
                cmd.Parameters.Add("@tc", SqlDbType.VarChar).Value       = h._hastaTC;
                cmd.Parameters.Add("@dg", SqlDbType.VarChar).Value       = h._hastaDG;
                cmd.Parameters.Add("@meslek", SqlDbType.VarChar).Value   = h._hastaMeslek;
                cmd.Parameters.Add("@kan", SqlDbType.VarChar).Value      = h._hastaKan;
                cmd.Parameters.Add("@tel", SqlDbType.VarChar).Value      = h._hastaTel;
                cmd.Parameters.Add("@il", SqlDbType.VarChar).Value       = h._hastaIl;
                cmd.Parameters.Add("@ilce", SqlDbType.VarChar).Value     = h._hastaIlce;
                cmd.Parameters.Add("@mh", SqlDbType.VarChar).Value       = h._hastaMh;
                cmd.Parameters.Add("@cd", SqlDbType.VarChar).Value       = h._hastaCd;
                cmd.Parameters.Add("@adres", SqlDbType.VarChar).Value    = h._hastaAdres;
                cmd.Parameters.Add("@baba", SqlDbType.VarChar).Value     = h._hastaBaba;
                cmd.Parameters.Add("@anne", SqlDbType.VarChar).Value     = h._hastaAnne;
                cmd.Parameters.Add("@dgyeri", SqlDbType.VarChar).Value   = h._hastaDGyeri;
                cmd.Parameters.Add("@cinsiyet", SqlDbType.VarChar).Value = h._hastaCinsiyet;
                cmd.Parameters.Add("@boy", SqlDbType.VarChar).Value      = h._hastaBoy;
                cmd.Parameters.Add("@kilo", SqlDbType.VarChar).Value     = h._hastaKilo;
                cmd.Parameters.Add("@mail", SqlDbType.VarChar).Value     = h._hastaMail;
                cmd.Parameters.Add("@kasa", SqlDbType.VarChar).Value     = h._hastaKasa;

                sonuc = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                con.Dispose();
                con.Close();
            }

            return(sonuc);
        }
示例#5
0
        public int hastaEkle(cHastalar h)
        {
            int sonuc = 0;

            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("Insert Into hastalar (hastaAdi,hastaSoyadi,hastaTC,hastaDG,hastaMeslek,hastaKan,hastaTel,hastaIl,hastaIlce,hastaMh,hastaCd,hastaAdres,hastaBaba,hastaAnne,hastaDGyeri,hastaCinsiyet,hastaBoy,hastaKilo,hastaMail,hastaKasa) values(@ad,@soyad,@tc,@dg,@meslek,@kan,@telefon,@il,@ilce,@mh,@cd,@adres,@baba,@anne,@dgyeri,@cinsiyet,@boy,@kilo,@mail,@kasa); select SCOPE_IDENTITY()", con);

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.Parameters.Add("@ad", SqlDbType.VarChar).Value       = h._hastaAdi;
                cmd.Parameters.Add("@soyad", SqlDbType.VarChar).Value    = h._hastaSoyadi;
                cmd.Parameters.Add("@tc", SqlDbType.VarChar).Value       = h._hastaTC;
                cmd.Parameters.Add("@dg", SqlDbType.VarChar).Value       = h._hastaDG;
                cmd.Parameters.Add("@meslek", SqlDbType.VarChar).Value   = h._hastaMeslek;
                cmd.Parameters.Add("@kan", SqlDbType.VarChar).Value      = h._hastaKan;
                cmd.Parameters.Add("@telefon", SqlDbType.VarChar).Value  = h._hastaTel;
                cmd.Parameters.Add("@il", SqlDbType.VarChar).Value       = h._hastaIl;
                cmd.Parameters.Add("@ilce", SqlDbType.VarChar).Value     = h._hastaIlce;
                cmd.Parameters.Add("@mh", SqlDbType.VarChar).Value       = h._hastaMh;
                cmd.Parameters.Add("@cd", SqlDbType.VarChar).Value       = h._hastaCd;
                cmd.Parameters.Add("@adres", SqlDbType.VarChar).Value    = h._hastaAdres;
                cmd.Parameters.Add("@baba", SqlDbType.VarChar).Value     = h._hastaBaba;
                cmd.Parameters.Add("@anne", SqlDbType.VarChar).Value     = h._hastaAnne;
                cmd.Parameters.Add("@dgyeri", SqlDbType.VarChar).Value   = h._hastaDGyeri;
                cmd.Parameters.Add("@cinsiyet", SqlDbType.VarChar).Value = h._hastaCinsiyet;
                cmd.Parameters.Add("@boy", SqlDbType.VarChar).Value      = h._hastaBoy;
                cmd.Parameters.Add("@kilo", SqlDbType.VarChar).Value     = h._hastaKilo;
                cmd.Parameters.Add("@mail", SqlDbType.VarChar).Value     = h._hastaMail;
                cmd.Parameters.Add("@kasa", SqlDbType.VarChar).Value     = h._hastaKasa;
                sonuc = Convert.ToInt32(cmd.ExecuteScalar());
            }
            catch (SqlException ex)
            {
                string hata = ex.Message;
            }
            finally
            {
                con.Dispose();
                con.Close();
            }


            return(sonuc);
        }
示例#6
0
        private void frmHastalar_Load(object sender, EventArgs e)
        {
            cHastalar c = new cHastalar();

            c.hastalariGetir(lvHastalar);
        }