NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

//kullanıcı giriş
private void Kullanici_Load(object sender, EventArgs e)
{

textBox2.PasswordChar = '*';
}

private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand cmd =new SqlCommand("Select * From kullanici where kadi=@kadi AND sifre=@sifre",baglanti);
cmd.Parameters.AddWithValue("@kadi",textBox1.Text);
cmd.Parameters.AddWithValue("@sifre",textBox2.Text);
SqlDataReader rd = cmd.ExecuteReader();
if (rd.Read())
{
Form1 frm = new Form2();
frm.Show();
this.Hide();
}
else
{
MessageBox.Show("Yanl giri yaptnz.KADݽadmin & Sifre=admin");
textBox1.Text = "";
textBox2.Text = "";
}

baglanti.Close();
}
//datagrid düzenleme
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();

//combobox veri getirme
void OgretmenGetir()
{
baglanti.Open();
SqlCommand cmd = new SqlCommand("select *from Bolum",baglanti);

SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
comboBox1.Items.Add(dr["ogretmen"]);
}
baglanti.Close();
}

// Datagrid listeleme
baglanti.Open();
SqlDataAdapter da = new SqlDataAdapter("select *from Urunler", baglanti);
DataTable tablo = new DataTable();
da.Fill(tablo);
dataGridView1.DataSource = tablo;
baglanti.Close();


// Arama butonu
SqlDataAdapter da = new SqlDataAdapter("Select * from Urunler where Ad Like '" + textBox1.Text + "%'", baglanti);// ½ işareti texbox sa girilen karakterden sonra sonuna hangi harf gelirse gelsin tümünü göster demektir.
DataTable ds = new DataTable();
baglanti.Open();

da.Fill(ds);
baglanti.Close();
dataGridView1.DataSource = ds;



SqlCommand komut = new SqlCommand("insert into Urunler(Ad,Süre)VALUES(@Ad,@Süre)", baglanti);
komut.Parameters.AddWithValue("@Ad", textBox2.Text);

SqlCommand komut = new SqlCommand("Update Urunler Set Ad=@Ad, Süre=@Süre where id=@id", baglanti);

SqlCommand komut = new SqlCommand("Delete from urunler where id=@id", baglanti);




------------------------------------------------------------------------------------------

SqlConnection baglanti = new SqlConnection("");





---------------------------------------------------------------------------------


string cinsiyet = "";
string calismadurum = "";
string sigortavarmi = "";

if (radioButton1.Checked == true)
{
cinsiyet = radioButton1.Text;
}
if (radioButton2.Checked == true)
{
cinsiyet = radioButton2.Text;
}
if (radioButton3.Checked == true)
{
calismadurum = radioButton3.Text;
}
if (radioButton4.Checked == true)
{
calismadurum = radioButton4.Text;
}
if (radioButton5.Checked == true)
{
sigortavarmi = radioButton5.Text;
}
if (radioButton6.Checked == true)
{
sigortavarmi = radioButton6.Text;
}
baglanti.Open();


SqlCommand komut = new SqlCommand("UPDATE veri_tabani set tc=@tc,ad=@ad,soyad=@soyad,id=@id,d_tarihi=@d_tarihi,telefon=@telefon,adres=@adres,cinsiyet=@cinsiyet,calisma_durumu=@calisma_durumu,meslek=@meslek,sigorta=@sigorta,sigorta_durumu=@sigorta_durumu,sigorta_baslan=@sigorta_baslan,doktor=@doktor WHERE id=@id",baglanti);
komut.Parameters.AddWithValue("@tc", textBox1.Text);
komut.Parameters.AddWithValue("@ad", textBox2.Text);
komut.Parameters.AddWithValue("@soyad", textBox3.Text);
komut.Parameters.AddWithValue("@id", textBox4.Text);
komut.Parameters.AddWithValue("@d_tarihi", donustur);
komut.Parameters.AddWithValue("@telefon", textBox5.Text);
komut.Parameters.AddWithValue("@adres", textBox7.Text);
komut.Parameters.AddWithValue("@cinsiyet", cinsiyet.ToString());
komut.Parameters.AddWithValue("@calisma_durumu", calismadurum.ToString());
komut.Parameters.AddWithValue("@meslek", textBox8.Text);
komut.Parameters.AddWithValue("@sigorta", sigortavarmi.ToString());
komut.Parameters.AddWithValue("@sigorta_durumu", comboBox4.Text);
komut.Parameters.AddWithValue("@sigorta_baslan", donustur2);
komut.Parameters.AddWithValue("@doktor", comboBox2.Text);
komut.ExecuteNonQuery();
MessageBox.Show("Güncellendi");
baglanti.Close();
kayitgetir();


--------------------------------------------------------------------------------------------


baglanti.Open();

//datetimepickerları string çevirmeden önce Propertiesden formatını custom yayıp daha sonra custom formda dd/MM/yyyy hh:mm:ss ekliyoruz
string donustur = dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss.FFF");
string donustur2 = dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss.FFF");


string cinsiyet="";
string calismadurum="";
string sigortavarmi="";

if (radioButton1.Checked==true)
{
cinsiyet = radioButton1.Text;
}
if (radioButton2.Checked==true)
{
cinsiyet = radioButton2.Text;
}
if (radioButton3.Checked==true)
{
calismadurum = radioButton3.Text;
}
if (radioButton4.Checked==true)
{
calismadurum = radioButton4.Text;
}
if (radioButton5.Checked==true)
{
sigortavarmi = radioButton5.Text;
}
if (radioButton6.Checked==true)
{
sigortavarmi=radioButton6.Text;
}

string kayit = "insert into veri_tabani(tc,ad,soyad,id,d_tarihi,telefon,adres,cinsiyet,calisma_durumu,meslek,sigorta,sigorta_durumu,sigorta_baslan,doktor)VALUES(@tc,@ad,@soyad,@id,@d_tarihi,@telefon,@adres,@cinsiyet,@calisma_durumu,@meslek,@sigorta,@sigorta_durumu,@sigorta_baslan,@doktor)";

SqlCommand komut = new SqlCommand(kayit, baglanti);
komut.Parameters.AddWithValue("@tc",textBox1.Text);
komut.Parameters.AddWithValue("@ad",textBox2.Text);
komut.Parameters.AddWithValue("@soyad",textBox3.Text);
komut.Parameters.AddWithValue("@id",textBox4.Text);
komut.Parameters.AddWithValue("@d_tarihi", donustur);
komut.Parameters.AddWithValue("@telefon",textBox5.Text);
komut.Parameters.AddWithValue("@adres",textBox7.Text);
komut.Parameters.AddWithValue("@cinsiyet",cinsiyet.ToString());
komut.Parameters.AddWithValue("@calisma_durumu",calismadurum.ToString());
komut.Parameters.AddWithValue("@meslek",textBox8.Text);
komut.Parameters.AddWithValue("@sigorta",sigortavarmi.ToString());
komut.Parameters.AddWithValue("@sigorta_durumu",comboBox4.Text);
komut.Parameters.AddWithValue("@sigorta_baslan", donustur2);
komut.Parameters.AddWithValue("@doktor",comboBox2.Text);
komut.ExecuteNonQuery();
komut.Dispose();
baglanti.Close();
MessageBox.Show("Kayıt İşlemi Biti");
kayitgetir();



------------------------------------------------------------------------------------------------------------------


baglanti.Open();
SqlCommand komut = new SqlCommand("DELETE from veri_tabani where id=@id",baglanti);
komut.Parameters.AddWithValue("@id", textBox4.Text);
komut.ExecuteNonQuery();
baglanti.Close();
MessageBox.Show("Silme İşlemi Tamamlandı");
kayitgetir();


------------------------------------------------------------------------------------------------------------------

void kayitgetir()
{
baglanti.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from veri_tabani",baglanti);
DataTable tablo = new DataTable();
da.Fill(tablo);
dataGridView1.DataSource = tablo;
baglanti.Close();
}

private void Form1_Load(object sender, EventArgs e)
{
kayitgetir();
}


------------------------------------------------------------------------------------------------------------

string cinsiyet = "";
string calisma = "";
string sigorta = "";
textBox4.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
textBox3.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
dateTimePicker1.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
textBox5.Text = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
textBox7.Text = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();

cinsiyet = dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString();
if (cinsiyet== "Kadın")
{
radioButton1.Checked = true;
}
else if (cinsiyet=="Erkek")
{
radioButton2.Checked = true;
}
calisma = dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString();
if (calisma == "Evet")
{
radioButton3.Checked = true;
}
else if (calisma == "Hayır")
{
radioButton4.Checked = true;
}
sigorta = dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString();
if (sigorta == "EVET")
{
radioButton5.Checked = true;
}
else if (sigorta == "HAYIR")
{
radioButton6.Checked = true;
}


---------------------------------------------------------------------------------------------------------------


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.