protected void Page_Load(object sender, EventArgs e) { if (Request.Form["ogrogr"] != null) { staj st = new staj(); string asd = FormsAuthentication.HashPasswordForStoringInConfigFile(Request.Form["sifre"], "SHA256"); MySqlCommand komut = new MySqlCommand("INSERT INTO ogrenci (ogr_no,ogr_sifre,ogr_ad,ogr_soyad,ogr_ogretim,ogr_dgs) VALUES (@ogrno,@ogrsifre,@ograd,@ogrsoyad,@ogrogr,@ogrdgs)", st.sa); komut.Parameters.AddWithValue("@ogrno", int.Parse(Request.Form["ogrno"])); komut.Parameters.AddWithValue("@ogrsifre", asd); komut.Parameters.AddWithValue("@ograd", Request.Form["ograd"]); komut.Parameters.AddWithValue("@ogrsoyad", Request.Form["ogrsoyad"]); komut.Parameters.AddWithValue("@ogrogr", int.Parse(Request.Form["ogrogr"])); komut.Parameters.AddWithValue("@ogrdgs", 0); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("login.aspx"); } if (Request.Form["hocaad"] != null) { staj st = new staj(); string asd = FormsAuthentication.HashPasswordForStoringInConfigFile(Request.Form["sifre"], "SHA256"); MySqlCommand komut = new MySqlCommand("INSERT INTO hoca (hoca_ad,hoca_sifre) VALUES (@hoca_ad,@hoca_sifre)", st.sa); komut.Parameters.AddWithValue("@hoca_ad", Request.Form["hocaad"]); komut.Parameters.AddWithValue("@hoca_sifre", asd); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["ogr"] == null) { Response.Redirect("login.aspx"); } mulakat1.HRef = "mulakat.aspx?ogrno=" + Session["ogr_no"]; if (Request.Form["staj_okul"] != null) { dgsClass k = new dgsClass(); k.ogr_no = (int)Session["ogr_no"]; k.dgs_okul = Request.Form["staj_okul"]; k.dgs_kabulgun = int.Parse(Request.Form["staj_gun"]) / 2; k.dgs_kurum = Request.Form["staj_kurum"]; dgsClass.insert(k); k.sa.Close(); staj st = new staj(); MySqlCommand komut = new MySqlCommand("UPDATE ogrenci SET ogr_dgs=@dgs where ogr_no=@ogr ", st.sa); komut.Parameters.AddWithValue("@ogr", k.ogr_no); komut.Parameters.AddWithValue("@dgs", 1); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("home.aspx"); } }
public static void insert(staj st) { MySqlCommand komut = new MySqlCommand("INSERT INTO staj (staj_kurum, staj_sehir, staj_bastarih,staj_bittarih,staj_gün,staj_konu,staj_sinif,ogr_no) VALUES(@kurum, @sehir,@bastarih,@bittarih,@gün,@konu,@sinif,@ogr_no)", st.sa); komut.Parameters.AddWithValue("@kurum", st.staj_kurum); komut.Parameters.AddWithValue("@sehir", st.staj_sehir); komut.Parameters.AddWithValue("@bastarih", st.staj_bastarih); komut.Parameters.AddWithValue("@bittarih", st.staj_bittarih); komut.Parameters.AddWithValue("@gün", st.staj_gün); komut.Parameters.AddWithValue("@konu", st.staj_konu); komut.Parameters.AddWithValue("@sinif", st.staj_sinif); komut.Parameters.AddWithValue("@ogr_no", st.ogr_no); st.sa.Open(); komut.ExecuteNonQuery(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Form["staj_kurum"] != null && Request.Form["staj_okul"] == null) { staj st = new staj(); mulakat mt = new mulakat(); st.staj_kurum = Request.Form["staj_kurum"]; st.staj_sehir = Request.Form["staj_sehir"]; st.staj_bastarih = Request.Form["staj_bastarih"]; st.staj_bittarih = Request.Form["staj_bittarih"]; st.staj_konu = Request.Form["staj_konu"]; st.staj_sinif = int.Parse(Request.Form["staj_sinif"]); st.staj_gün = int.Parse(Request.Form["staj_gun"]); st.ogr_no = (int)Session["ogr_no"]; staj.insert(st); Response.Redirect("home.aspx"); } if (Request.Form["komisyonadi"] != null) { staj st = new staj(); MySqlCommand komut = new MySqlCommand("INSERT INTO komisyon (komisyon_adi) VALUES (@komisyon)", st.sa); komut.Parameters.AddWithValue("@komisyon", Request.Form["komisyonadi"]); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("komisyon.aspx"); } if (Request.QueryString["hocaid"] != null) { staj st = new staj(); MySqlCommand komut = new MySqlCommand("UPDATE hoca SET komisyon_adi=@komisyon where hoca_id=@hid ", st.sa); komut.Parameters.AddWithValue("@komisyon", Request.Form["komisyon_adi"]); komut.Parameters.AddWithValue("@hid", Request.QueryString["hocaid"]); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("komisyon.aspx"); } if (Request.QueryString["stajno"] != null) { staj st = new staj(); if (Request.Form["mulakat_puan"] != "0") { MySqlCommand komut2 = new MySqlCommand("SELECT staj_deger,staj_gün FROM staj where staj_no=@staj", st.sa); komut2.Parameters.AddWithValue("@staj", Request.Form["staj_no"]); st.sa.Open(); var reader = komut2.ExecuteReader(); reader.Read(); double gun = (double.Parse(Request.Form["mulakat_puan"]) / 100) * (int)reader["staj_gün"]; reader.Close(); MySqlCommand komut = new MySqlCommand("UPDATE staj SET staj_deger=@deger,mulakat_tarih=@tarih,mulakat_saat=@saat,mulakat_puan=@puan,komisyon_adi=@kadi,staj_kabulgun=@kgun where staj_no=@staj", st.sa); komut.Parameters.AddWithValue("@tarih", Request.Form["mulakat_tarih"]); komut.Parameters.AddWithValue("@saat", Request.Form["mulakat_saat"]); komut.Parameters.AddWithValue("@staj", Request.Form["staj_no"]); komut.Parameters.AddWithValue("@puan", Request.Form["mulakat_puan"]); komut.Parameters.AddWithValue("@kadi", Request.Form["komisyon_adi"]); komut.Parameters.AddWithValue("@kgun", gun); komut.Parameters.AddWithValue("@deger", 1); komut.ExecuteNonQuery(); Response.Redirect("home2.aspx"); } else { MySqlCommand komut = new MySqlCommand("UPDATE staj SET mulakat_tarih=@tarih,mulakat_saat=@saat,komisyon_adi=@kadi where staj_no=@staj", st.sa); komut.Parameters.AddWithValue("@tarih", Request.Form["mulakat_tarih"]); komut.Parameters.AddWithValue("@saat", Request.Form["mulakat_saat"]); komut.Parameters.AddWithValue("@staj", Request.Form["staj_no"]); komut.Parameters.AddWithValue("@kadi", Request.Form["komisyon_adi"]); st.sa.Open(); komut.ExecuteNonQuery(); Response.Redirect("home2.aspx"); } } }