private void button6_Click(object sender, EventArgs e) { this.Hide(); ControlCharity control = new ControlCharity(); control.Show(); }
private void button4_Click(object sender, EventArgs e) { sqlconn = new SqlConnection(connection); sqlconn.Open(); if (textBox1.Text != "" && textBox1.Text.Contains(" ") == false) { try { if (textBox2.Text != "") { File.Copy(path + @"\" + textBox2.Text, @"C:\Users\Roman\Desktop\ТРПО Шимбирев\d\" + textBox2.Text); } } catch { } if (ControlCharity.prov == false) { SqlCommand select = new SqlCommand("insert into Charity values(@CharityName,@CharityDescription,@CharityLogo);", sqlconn); select.Parameters.AddWithValue("CharityName", textBox1.Text); select.Parameters.AddWithValue("CharityDescription", textBox4.Text); select.Parameters.AddWithValue("CharityLogo", textBox2.Text); select.ExecuteNonQuery(); this.Hide(); ControlCharity control = new ControlCharity(); control.Show(); } else { SqlCommand select = new SqlCommand("Update Charity set CharityName = @CharityName,CharityDescription = @CharityDescription,CharityLogo = @CharityLogo where CharityId = '" + ControlCharity.index + "';", sqlconn); select.Parameters.AddWithValue("CharityName", textBox1.Text); select.Parameters.AddWithValue("CharityDescription", textBox4.Text); select.Parameters.AddWithValue("CharityLogo", textBox2.Text); select.ExecuteNonQuery(); ControlCharity control = new ControlCharity(); control.Show(); } } else { MessageBox.Show("Имя организации не корректно"); } }
private void button5_Click(object sender, EventArgs e) { ControlCharity control = new ControlCharity(); control.Show(); }