Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con            = dbcon.connection();
            com            = new OracleCommand();
            com.Connection = con;

            int secilenKitapId = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value);

            try
            {
                com.CommandText = "DELETE FROM OduncVer WHERE KitapID ='" + secilenKitapId + "'";
                com.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("İade İşlemi Başarılı TEŞEKKÜR EDERİZ");
            }
            catch
            {
                MessageBox.Show("İade İşlemi Başarısız");
            }
            DataTable         dataTable2         = new DataTable();
            OracleDataAdapter oracleDataAdapter2 = new OracleDataAdapter("SELECT * FROM OduncVer WHERE UyeTc = '" + UyeLogin.metin + "'", con);

            oracleDataAdapter2.Fill(dataTable2);
            dataGridView1.DataSource = dataTable2;
            oracleDataAdapter2.Update(dataTable2);
            con.Close();
            textBox8.Clear();
        }
Exemple #2
0
        private void OduncVer_Load(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Books", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource = dataTable;
            //kolon isimlerini değiştirme
            dataGridView1.Columns[0].HeaderText = "Kitap ID";
            dataGridView1.Columns[1].HeaderText = "Kitap Adı";
            dataGridView1.Columns[2].HeaderText = "Yazarı";
            dataGridView1.Columns[3].HeaderText = "Yayınevi";
            dataGridView1.Columns[4].HeaderText = "Sayfa Sayısı";

            DataTable         dataTable2         = new DataTable();
            OracleDataAdapter oracleDataAdapter2 = new OracleDataAdapter("SELECT * FROM OduncVer", con);

            oracleDataAdapter2.Fill(dataTable2);
            dataGridView2.DataSource = dataTable2;
            //kolon isimlerini değiştirme
            dataGridView2.Columns[0].HeaderText = "Kitap ID";
            dataGridView2.Columns[1].HeaderText = "TC Kimlik No";
            dataGridView2.Columns[2].HeaderText = "Kitap Adı";
            dataGridView2.Columns[3].HeaderText = "Üye Adı";
            dataGridView2.Columns[4].HeaderText = "Üye Soyadı";
            dataGridView2.Columns[5].HeaderText = "Ödünç Tarihi";
            dataGridView2.Columns[6].HeaderText = "İade Tarihi";
        }
Exemple #3
0
        private void Profilim_Load(object sender, EventArgs e)
        {
            groupBox1.Visible = true;
            groupBox2.Visible = false;
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM Uyeler WHERE UyeTc ='" + UyeLogin.metin + "'";

            dr = com.ExecuteReader();

            if (dr.Read())
            {
                textBox2.Text = dr[2].ToString();
                textBox1.Text = dr[3].ToString();
                textBox4.Text = dr[5].ToString();
                textBox3.Text = dr[0].ToString();
                textBox5.Text = dr[1].ToString();
                textBox6.Text = dr[6].ToString();
                label3.Text   = dr[2].ToString() + " " + dr[3].ToString();
            }
            con.Close();
        }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult uyeSil = MessageBox.Show("Gerçekten Silmek İstiyor musunuz? ",
                                                  "Silme İşlemi", MessageBoxButtons.YesNo);

            if (uyeSil == DialogResult.Yes)
            {
                DbCon dbcon = new DbCon();
                con             = dbcon.connection();
                com             = new OracleCommand();
                com.Connection  = con;
                com.CommandText = "DELETE FROM Uyeler WHERE UyeID ='" + textBox2.Text + "'";
                com.ExecuteNonQuery();
                con.Close();
                MessageBox.Show("Silme Başarılı");
            }
            else
            {
                MessageBox.Show("İşlem İptal Edildi.");
            }
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
            textBox5.Clear();
            textBox6.Clear();
            textBox7.Clear();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                textBox2.Visible = true;
                textBox3.Visible = true;
                textBox4.Visible = true;
                textBox5.Visible = true;
                label2.Visible   = true;
                label3.Visible   = true;
                label4.Visible   = true;
                label5.Visible   = true;
            }
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM Books WHERE BookID ='" + textBox1.Text + "'";
            dr = com.ExecuteReader();
            if (dr.Read())
            {
                textBox2.Text = dr[1].ToString();
                textBox3.Text = dr[2].ToString();
                textBox4.Text = dr[3].ToString();
                textBox5.Text = dr[4].ToString();
            }
            else
            {
                MessageBox.Show("Kitap Bulunamadı");
            }
            con.Close();
        }
Exemple #6
0
        private void button5_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            OracleCommand     komut       = new OracleCommand("SELECT * FROM OduncVer WHERE KitapID LIKE '%" + textBox8.Text + "%'", con);
            DataTable         dataTable2  = new DataTable();
            OracleDataAdapter dataAdapter = new OracleDataAdapter(komut);

            dataAdapter.Fill(dataTable2);
            dataGridView2.DataSource = dataTable2;
        }
Exemple #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            OracleCommand     komut       = new OracleCommand("SELECT * FROM Books WHERE BookName LIKE '%" + textBox7.Text + "%' or BookAuthor like '%" + textBox7.Text + "%' or BookPublisher like '%" + textBox7.Text + "%'", con);
            DataTable         dataTable2  = new DataTable();
            OracleDataAdapter dataAdapter = new OracleDataAdapter(komut);

            dataAdapter.Fill(dataTable2);
            dataGridView1.DataSource = dataTable2;
        }
Exemple #8
0
        private void button5_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "UPDATE Uyeler SET UyeTc='" + textBox5.Text + "',UyeAd='" + textBox2.Text + "',UyeSoyad='" + textBox1.Text + "',UyeTel='"
                              + textBox4.Text + "',UyeSıfre='" + textBox6.Text + "' where UyeID=" + textBox3.Text + "";
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Değişiklikler Kaydedildi");
        }
Exemple #9
0
        private void UyeOdunc_Load(object sender, EventArgs e)
        {
            {
                DbCon dbcon = new DbCon();
                con = dbcon.connection();
                DataTable         dataTable         = new DataTable();
                OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Books", con);
                oracleDataAdapter.Fill(dataTable);
                dataGridView1.DataSource = dataTable;
                //kolon isimlerini değiştirme
                dataGridView1.Columns[0].HeaderText = "Kitap ID";
                dataGridView1.Columns[1].HeaderText = "Kitap Adı";
                dataGridView1.Columns[2].HeaderText = "Yazarı";
                dataGridView1.Columns[3].HeaderText = "Yayınevi";
                dataGridView1.Columns[4].HeaderText = "Sayfa Sayısı";

                DataTable         dataTable2         = new DataTable();
                OracleDataAdapter oracleDataAdapter2 = new OracleDataAdapter("SELECT * FROM OduncVer WHERE UyeTc = '" + UyeLogin.metin + "'", con);
                oracleDataAdapter2.Fill(dataTable2);
                dataGridView2.DataSource = dataTable2;
                //kolon isimlerini değiştirme
                dataGridView2.Columns[0].HeaderText = "Kitap ID";
                dataGridView2.Columns[1].HeaderText = "TC Kimlik No";
                dataGridView2.Columns[2].HeaderText = "Kitap Adı";
                dataGridView2.Columns[3].HeaderText = "Üye Adı";
                dataGridView2.Columns[4].HeaderText = "Üye Soyadı";
                dataGridView2.Columns[5].HeaderText = "Ödünç Tarihi";
                dataGridView2.Columns[6].HeaderText = "İade Tarihi";
            }

            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM Uyeler WHERE UyeTc ='" + UyeLogin.metin + "'";

            dr = com.ExecuteReader();

            if (dr.Read())
            {
                textBox2.Text = dr[0].ToString();
                textBox1.Text = dr[1].ToString();
                textBox3.Text = dr[2].ToString();
                textBox4.Text = dr[3].ToString();
                textBox5.Text = dr[4].ToString();
                textBox6.Text = dr[5].ToString();
            }
            con.Close();
        }
        private void KitapGuncelle_Load(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Books", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource = dataTable;
            //kolon isimlerini değiştirme
            dataGridView1.Columns[0].HeaderText = "Kitap ID";
            dataGridView1.Columns[1].HeaderText = "Kitap Adı";
            dataGridView1.Columns[2].HeaderText = "Yazarı";
            dataGridView1.Columns[3].HeaderText = "Yayınevi";
            dataGridView1.Columns[4].HeaderText = "Sayfa Sayısı";
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "UPDATE Uyeler set UyeTc='" + textBox1.Text + "',UyeAd='" + textBox2.Text + "',UyeSoyad='" + textBox3.Text + "',UyeTel='"
                              + textBox4.Text + "',UyeSıfre='" + textBox5.Text + "' where UyeID=" + textBox6.Text + "";
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Güncelleme Başarılı");
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Uyeler", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource = dataTable;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "INSERT INTO Books (BookName, BookAuthor, BookPublisher, BookPageNumber) " +
                              "VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox4.Text + "','"
                              + Convert.ToDecimal(textBox3.Text) + "')";
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Bağışınız İçin Teşekkürler");
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
        }
Exemple #13
0
        private void UyeKitapIade_Load(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM OduncVer WHERE UyeTc = '" + UyeLogin.metin + "'", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource = dataTable;
            //kolon isimlerini değiştirme
            dataGridView1.Columns[0].HeaderText = "Kitap ID";
            dataGridView1.Columns[1].HeaderText = "TC Kimlik No";
            dataGridView1.Columns[2].HeaderText = "Kitap Adı";
            dataGridView1.Columns[3].HeaderText = "Üye Adı";
            dataGridView1.Columns[4].HeaderText = "Üye Soyadı";
            dataGridView1.Columns[5].HeaderText = "Ödünç Tarihi";
            dataGridView1.Columns[6].HeaderText = "İade Tarihi";
        }
        private void UyeGuncelle_Load(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con = dbcon.connection();
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Uyeler", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource         = dataTable;
            dataGridView1.Columns[6].Visible = false;
            //kolon isimlerini değiştirme
            dataGridView1.Columns[0].HeaderText = "Üye ID";
            dataGridView1.Columns[1].HeaderText = "TC Kimlik No";
            dataGridView1.Columns[2].HeaderText = "Adı";
            dataGridView1.Columns[3].HeaderText = "Soyadı";
            dataGridView1.Columns[4].HeaderText = "Cinsiyet";
            dataGridView1.Columns[5].HeaderText = "Telefon No";
            dataGridView1.Columns[6].HeaderText = "Şifre";
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandType = CommandType.StoredProcedure;
            com.CommandText = "sp_addbook";
            com.Parameters.Add("bookName", OracleDbType.Varchar2, 100).Value      = textBox1.Text;
            com.Parameters.Add("bookAuthor", OracleDbType.Varchar2, 100).Value    = textBox2.Text;
            com.Parameters.Add("bookPublisher", OracleDbType.Varchar2, 100).Value = textBox4.Text;
            com.Parameters.Add("bookPageNumber", OracleDbType.Decimal).Value      = Convert.ToDecimal(textBox3.Text);
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Kayıt Başarılı");
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "INSERT INTO Uyeler (UyeTc, UyeAd, UyeSoyad, UyeCinsiyet, UyeTel, UyeSifre) " +
                              "VALUES ('" + Convert.ToDecimal(textBox1.Text) + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textCinsiyet.Text + "','"
                              + Convert.ToDecimal(textBox4.Text) + "','" + textBox5.Text + "')";
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Kayıt Gerçekleştirildi");
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
            textBox5.Clear();
            checkBox1.Checked = false;
            checkBox2.Checked = false;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM ADMIN where ADMINTC ='" + textBox1.Text + "' AND SIFRE='" + textBox2.Text + "'";
            dr = com.ExecuteReader();

            if (dr.Read())
            {
                Yukleniyor yukleniyor = new Yukleniyor();
                yukleniyor.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı ve ya Şifre Hatalı");
            }
            con.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "update Books set BookName='" + textBox1.Text + "',BookPublisher='" + textBox4.Text + "',BookAuthor='" + textBox2.Text + "',BookPageNumber='"
                              + Convert.ToDecimal(textBox3.Text) + "' where BookID=" + Convert.ToDecimal(textBox5.Text) + "";
            com.ExecuteNonQuery();
            con.Close();
            MessageBox.Show("Güncelleme Başarılı");
            DataTable         dataTable         = new DataTable();
            OracleDataAdapter oracleDataAdapter = new OracleDataAdapter("SELECT * FROM Books", con);

            oracleDataAdapter.Fill(dataTable);
            dataGridView1.DataSource = dataTable;
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
        }
Exemple #19
0
        private void button4_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con            = dbcon.connection();
            com            = new OracleCommand();
            com.Connection = con;

            string tarih = dateTimePicker1.Value.ToString();

            com.CommandText = "SELECT * FROM Uyeler WHERE UyeTc ='" + textBox1.Text + "'";


            int    secilenKitapId  = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value);
            string secilenKitapAdi = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);

            com.CommandText = "SELECT * FROM Books WHERE BookId ='" + secilenKitapId + "'";
            try
            {
                com.CommandText = "INSERT INTO OduncVer (UyeTc, OgrenciAdi, OgrenciSoyadi, KitapID, KitapAdi, OduncTarihi, IadeTarihi) " +
                                  "VALUES ('" + textBox1.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + secilenKitapId + "','" + secilenKitapAdi + "','" + tarih + "','"
                                  + dateTimePicker1.Value.AddDays(15).ToString() + "')";
                com.ExecuteNonQuery();
                MessageBox.Show("Ödünç Verme Başarılı");
            }
            catch
            {
                MessageBox.Show("Bu Kitap Daha Önce Alınmış");
            }
            DataTable         dataTable2         = new DataTable();
            OracleDataAdapter oracleDataAdapter2 = new OracleDataAdapter("SELECT * FROM OduncVer WHERE UyeTc ='" + textBox1.Text + "'", con);

            oracleDataAdapter2.Fill(dataTable2);
            dataGridView2.DataSource = dataTable2;
            oracleDataAdapter2.Update(dataTable2);
            con.Close();
            textBox7.Clear();
        }
Exemple #20
0
        private void button3_Click(object sender, EventArgs e)
        {
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM Uyeler WHERE UyeTc ='" + textBox1.Text + "'";
            dr = com.ExecuteReader();
            if (dr.Read())
            {
                textBox2.Text = dr["UyeID"].ToString();
                textBox3.Text = dr[2].ToString();
                textBox4.Text = dr[3].ToString();
                textBox5.Text = dr[4].ToString();
                textBox6.Text = dr[5].ToString();
            }
            else
            {
                MessageBox.Show("Üye Bulunamadı");
            }
            con.Close();
        }
Exemple #21
0
        private void button1_Click(object sender, EventArgs e)
        {
            metin = textBox1.Text;
            DbCon dbcon = new DbCon();

            con             = dbcon.connection();
            com             = new OracleCommand();
            com.Connection  = con;
            com.CommandText = "SELECT * FROM Uyeler WHERE UyeTc ='" + textBox1.Text + "' AND UyeSifre='" + textBox2.Text + "'";
            dr = com.ExecuteReader();

            if (dr.Read())
            {
                MenuUye menuUye = new MenuUye();
                menuUye.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Kullanıcı Adı ve ya Şifre Hatalı");
            }
            con.Close();
        }