private void frmOgrMesajGonder_Load(object sender, EventArgs e) { try { sqlBaglan.BaglantiAc(); frmOgrSistem frmOgrSistem = new frmOgrSistem(); OgrNo = frmOgrSistem.OgrenciNo; sqlBaglan.sorgu.Parameters.Clear(); sqlBaglan.sorgu.Connection = sqlBaglan.baglan; sqlBaglan.sorgu.CommandText = "SELECT * FROM tbl_bolumler bol INNER JOIN tbl_akademisyenler aka ON aka.akaBolum = bol.bolumKodu INNER JOIN tbl_ogrenciler ogr ON ogr.ogrBolum = bol.bolumKodu WHERE ogr.ogrNo=@ogrNo;"; sqlBaglan.sorgu.Parameters.AddWithValue("@ogrNo", OgrNo); sqlBaglan.dataReader = sqlBaglan.sorgu.ExecuteReader(); if (sqlBaglan.dataReader.Read()) { txtOgrKime.Text = sqlBaglan.dataReader["akaNo"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlBaglan.BaglantiKapat(); sqlBaglan.sorgu.Parameters.Clear(); } }
private void btnOgrenciGiris_Click(object sender, EventArgs e) { frmOgrSistem frmOgrSistem = new frmOgrSistem(); frmOgrSistem.Show(); this.Hide(); }
private void frmOgrSistemEkrani_Load(object sender, EventArgs e) { try { frmOgrSistem frmOgrSistem = new frmOgrSistem(); OgrNo = frmOgrSistem.OgrenciNo; sqlBaglan.BaglantiAc(); sqlBaglan.sorgu.Parameters.Clear(); sqlBaglan.sorgu.CommandText = "SELECT ogr.ogrAdi,ogr.ogrSoyadi,ogr.ogrGNO,ogr.ogrSinif,bol.bolumAdi FROM tbl_ogrenciler ogr INNER JOIN tbl_bolumler bol ON bol.bolumKodu = ogr.ogrBolum WHERE ogr.ogrNo = @ogrNo"; // WHERE ogr.ogrNo = '2016103001' sqlBaglan.sorgu.Parameters.AddWithValue("@ogrNo", OgrNo); sqlBaglan.sorgu.Connection = sqlBaglan.baglan; sqlBaglan.dataReader = sqlBaglan.sorgu.ExecuteReader(); if (sqlBaglan.dataReader.Read()) { ogrGNO = Convert.ToDouble(sqlBaglan.dataReader["ogrGNO"]); OgrSinif = sqlBaglan.dataReader["ogrSinif"].ToString(); lblOgrNo.Text = OgrNo; lblOgrAdi.Text = sqlBaglan.dataReader["ogrAdi"].ToString(); lblOgrSoyad.Text = sqlBaglan.dataReader["ogrSoyadi"].ToString(); lblOgrGNO.Text = Math.Round(ogrGNO, 2).ToString(); //2,3486459551345 -> 2,34 lblSinif.Text = OgrSinif; lblBolum.Text = sqlBaglan.dataReader["bolumAdi"].ToString(); sqlBaglan.dataReader.Close(); sqlBaglan.sorgu.Parameters.Clear(); sqlBaglan.da.Dispose(); sqlBaglan.sorgu.CommandText = "SELECT ders.dersKodu,ders.dersAdi,ders.dersKredi,nott.dersVize,nott.dersFinal,nott.dersOrt,harf.harfAdi FROM tbl_ogrenciler ogr INNER JOIN tbl_bolumler bol ON bol.bolumKodu = ogr.ogrBolum INNER JOIN tbl_notlar nott ON nott.ogrNo = ogr.ogrNo INNER JOIN tbl_harfSistemi harf ON harf.id = nott.dersHarfID INNER JOIN tbl_dersler ders ON ders.dersKodu = nott.dersKodu WHERE ogr.ogrNo = @ogrNo AND ders.dersSinif= @dersSinif"; sqlBaglan.sorgu.Connection = sqlBaglan.baglan; sqlBaglan.sorgu.Parameters.AddWithValue("@ogrNo", OgrNo); sqlBaglan.sorgu.Parameters.AddWithValue("@dersSinif", OgrSinif); sqlBaglan.da.SelectCommand = sqlBaglan.sorgu; sqlBaglan.sorgu.ExecuteNonQuery(); DataTable dtt = new DataTable(); sqlBaglan.da.Fill(dtt); foreach (DataRow item in dtt.Rows) { int n = dataGridView2.Rows.Add(); dataGridView2.Rows[n].Cells[0].Value = item["dersKodu"].ToString(); dataGridView2.Rows[n].Cells[1].Value = item["dersAdi"].ToString(); dataGridView2.Rows[n].Cells[2].Value = item["dersVize"].ToString(); dataGridView2.Rows[n].Cells[3].Value = item["dersFinal"].ToString(); dataGridView2.Rows[n].Cells[4].Value = item["dersOrt"].ToString(); dataGridView2.Rows[n].Cells[5].Value = item["dersKredi"].ToString(); dataGridView2.Rows[n].Cells[6].Value = item["harfAdi"].ToString(); } /*Ders Kaydı Kısmı Doluyor*/ dersKaydi(); /*Ders Kaydı Kısmı Doluyor Son*/ Ayarlar(); devamsizlik(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MesajCek() { try { dataGridView1.Rows.Clear(); frmOgrSistem frmOgrSistem = new frmOgrSistem(); OgrNo = frmOgrSistem.OgrenciNo; sqlBaglan.BaglantiAc(); sqlBaglan.sorgu.Parameters.Clear(); sqlBaglan.sorgu.Connection = sqlBaglan.baglan; sqlBaglan.sorgu.CommandText = "SELECT ogrNo,akaNo,konu,mesaj,tarih,durum,nerdenNereye,id FROM tbl_mesajlar WHERE ogrNo=@ogrNo ORDER BY tarih DESC"; sqlBaglan.sorgu.Parameters.AddWithValue("@ogrNo", OgrNo); sqlBaglan.da.SelectCommand = sqlBaglan.sorgu; sqlBaglan.sorgu.ExecuteNonQuery(); DataTable dt = new DataTable(); sqlBaglan.da.Fill(dt); foreach (DataRow item in dt.Rows) { int n = dataGridView1.Rows.Add(); if (item["durum"].ToString().Equals("1")) { durum = "OKUNDU"; } else { durum = "OKUNMADI"; }; if (item["nerdenNereye"].ToString().Equals("0")) { kimden = "HOCADAN"; } else { kimden = "ÖĞRENCİDEN"; }; dataGridView1.Rows[n].Cells[0].Value = item["akaNo"].ToString(); dataGridView1.Rows[n].Cells[1].Value = item["ogrNo"].ToString(); dataGridView1.Rows[n].Cells[2].Value = item["konu"].ToString(); dataGridView1.Rows[n].Cells[3].Value = item["mesaj"].ToString(); dataGridView1.Rows[n].Cells[4].Value = item["tarih"].ToString(); dataGridView1.Rows[n].Cells[5].Value = durum; dataGridView1.Rows[n].Cells[6].Value = kimden; dataGridView1.Rows[n].Cells[7].Value = item["id"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }