Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Diagnostics;
- using System.Windows.Forms;
- using System.Drawing.Imaging;
- using MySql.Data.MySqlClient;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
- {
- }
- private void toolStripLabel1_Click(object sender, EventArgs e)
- {
- }
- private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
- {
- }
- private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
- {
- }
- private void tToolStripMenuItem_Click(object sender, EventArgs e)
- {
- }
- private void toolStripComboBox1_Click(object sender, EventArgs e)
- {
- }
- private void toolStripButton2_Click(object sender, EventArgs e)
- {
- }
- private void label3_Click(object sender, EventArgs e)
- {
- }
- private void toolStripStatusLabel1_Click(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void richTextBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void pendingWarsToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- }
- private void contactU214ToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- Process.Start("http://www.xfire.com/profile/214hitmanblazed214/", null);
- }
- private void tabPage1_Click_1(object sender, EventArgs e)
- {
- }
- private void tabPage2_Click(object sender, EventArgs e)
- {
- }
- private void label1_Click_1(object sender, EventArgs e)
- {
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- if (textBox1.Text.Trim() == "")
- {
- MessageBox.Show("ERROR: Seems Like You Forgot To Enter The Clan Name!");
- return;
- }
- if (textBox2.Text.Trim() == "")
- {
- MessageBox.Show("ERROR: Seems Like You Forgot To Enter The Date!");
- return;
- }
- if (textBox3.Text.Trim() == "")
- {
- MessageBox.Show("ERROR: Seems Like You Forgot To Enter The Match Type!");
- return;
- }
- if (richTextBox1.Text.Trim() == "")
- {
- MessageBox.Show("ERROR: Seems Like You Forgot To Enter The Rules!");
- return;
- }
- string connString = "Server=localhost;Database=request;Uid=root;Pwd=;";
- using (MySqlConnection mcon = new MySqlConnection(connString))
- using (MySqlCommand cmd = mcon.CreateCommand())
- {
- mcon.Open();
- cmd.CommandText = "SELECT * FROM requesttcw";
- using (MySqlDataReader reader = cmd.ExecuteReader())
- {
- while (reader.Read())
- {
- Console.WriteLine(reader["ID"]);
- Console.WriteLine(reader["ClanName"]);
- Console.WriteLine(reader["Date"]);
- Console.WriteLine(reader["Type"]);
- Console.WriteLine(reader["Rules"]);
- }
- }
- }
- using (MySqlConnection mcon = new MySqlConnection(connString))
- using (MySqlCommand cmd = mcon.CreateCommand())
- {
- mcon.Open();
- cmd.CommandText = "INSERT INTO requesttcw (ClanName, Date, Type, Rules) VALUES (@ClanName, @Date, @Type, @Rules)";
- cmd.Parameters.AddWithValue("@ClanName", textBox1.Text);
- cmd.Parameters.AddWithValue("@Date", textBox2.Text);
- cmd.Parameters.AddWithValue("@Type", textBox3.Text);
- cmd.Parameters.AddWithValue("@Rules", richTextBox1.Text);
- cmd.ExecuteNonQuery();
- }
- textBox1.Clear();
- textBox2.Clear();
- textBox3.Clear();
- richTextBox1.Clear();
- MessageBox.Show("Your request has been successfully submitted!");
- }
- private void label6_Click(object sender, EventArgs e)
- {
- }
- private void label7_Click(object sender, EventArgs e)
- {
- }
- private void label9_Click(object sender, EventArgs e)
- {
- }
- private void listView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- }
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- }
- private void button3_Click(object sender, EventArgs e)
- {
- string connString = "Server=localhost;Database=request;Uid=root;Pwd=;";
- using (MySqlConnection mcon = new MySqlConnection(connString))
- using (MySqlCommand cmd = mcon.CreateCommand())
- {
- mcon.Open();
- cmd.CommandText = "SELECT * FROM requesttcw";
- using (MySqlDataReader reader = cmd.ExecuteReader())
- {
- while (reader.Read())
- {
- Console.WriteLine(reader["ID"]);
- Console.WriteLine(reader["ClanName"]);
- Console.WriteLine(reader["Date"]);
- Console.WriteLine(reader["Type"]);
- Console.WriteLine(reader["Rules"]);
- textBox5.text = reader["ID"];
- }
- }
- }
- using (MySqlConnection mcon = new MySqlConnection(connString))
- using (MySqlCommand cmd = mcon.CreateCommand())
- {
- mcon.Open();
- cmd.CommandText = "UPDATE FROM* requesttcw (ClanName, Date, Type, Rules) VALUES (@ClanName, @Date, @Type, @Rules)";
- cmd.Parameters.AddWithValue("@ClanName", textBox1.Text);
- cmd.Parameters.AddWithValue("@Date", textBox2.Text);
- cmd.Parameters.AddWithValue("@Type", textBox3.Text);
- cmd.Parameters.AddWithValue("@Rules", richTextBox1.Text);
- cmd.ExecuteNonQuery();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement