public void dersSil(VAR.ders Sders) { SqlCommand cmd = new SqlCommand("derssil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@dersno", Sders.Dersno); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
private void button1_Click(object sender, EventArgs e) { try { VAR.ders yders = new Varlıklar.ders(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text); yders.Dersno = yeniders.DGuncelle(yders); ((Form3)this.Owner).derslistele(); this.Visible = false; } catch { MessageBox.Show("Hatalı işlem."); } }
public int DGuncelle(VAR.ders ders) { SqlCommand cmd = new SqlCommand("dersduzenle", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@dersadi", ders.Dersadi); cmd.Parameters.AddWithValue("@bolum", ders.Bolum); cmd.Parameters.AddWithValue("@hocasi", ders.Hocasi); cmd.Parameters.AddWithValue("@donem", ders.Donem); con.Open(); int id = Convert.ToInt32(cmd.ExecuteScalar()); con.Close(); return(id); }
private void button3_Click(object sender, EventArgs e) { VAR.ders dersSil = new VAR.ders(Convert.ToInt32(dataGridView3.SelectedRows[0].Cells[0].Value)); yeniders.dersSil(dersSil); derslistele(); }