weekend33
New member
- Joined
- Jun 19, 2023
- Messages
- 2
- Programming Experience
- Beginner
Первое окно
Второе окно
Третье окно
Четвёртое окно
Пятое окно
Шестое окно
Please accept this article. I need it to pass the exam, after which I am ready to delete it. I was very grateful, because this will decide the fate of my red diploma.
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace kod1._2_var6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void план_мероприятийBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.план_мероприятийBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this._sergutin_kod1_2DataSet);
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: данная строка кода позволяет загрузить данные в таблицу "_sergutin_kod1_2DataSet.План_мероприятий". При необходимости она может быть перемещена или удалена.
this.план_мероприятийTableAdapter.Fill(this._sergutin_kod1_2DataSet.План_мероприятий);
}
private void план_мероприятийDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
план_мероприятийBindingSource.Filter = "Событие='" + comboBox1.Text + "'";
}
private void button2_Click(object sender, EventArgs e)
{
for (int i = 0; i < план_мероприятийDataGridView.ColumnCount - 1; i++)
{
for (int j = 0; j < план_мероприятийDataGridView.RowCount - 1; j++)
{
план_мероприятийDataGridView[i, j].Style.BackColor = Color.White; план_мероприятийDataGridView[i, j].Style.ForeColor = Color.Black;
}
}
for (int i = 0; i < план_мероприятийDataGridView.ColumnCount - 1; i++)
{
for (int j = 0; j < план_мероприятийDataGridView.RowCount - 1; j++)
{
if (план_мероприятийDataGridView[i, j].Value.ToString().IndexOf(textBox1.Text) != -1)
{
план_мероприятийDataGridView[i, j].Style.BackColor = Color.AliceBlue; план_мероприятийDataGridView[i, j].Style.ForeColor = Color.Blue;
}
}
}
}
private void button3_Click(object sender, EventArgs e)
{
план_мероприятийBindingSource.Filter = "";
}
private void button4_Click(object sender, EventArgs e)
{
Login newForm = new Login();
this.Hide();
newForm.Show();
}
}
}
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace kod1._2_var6
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Form1 newForm = new Form1();
this.Hide();
newForm.Show();
}
public static string SetValueForText1 = "";
public static string SetValueForText2 = "";
private void button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=SERVER_BIT\SQLEXPRESS;Initial Catalog=sergutin_kod1.2;User ID=user1;Password=userdb1
");
try
{
if (radioButton1.Checked == true)
{
String querry = "SELECT * FROM Участники WHERE Почта = '" + textBox1.Text + "' AND пароль = '" + textBox2.Text + "'";
SqlDataAdapter sda = new SqlDataAdapter(querry, conn);
DataTable dtable = new DataTable();
sda.Fill(dtable);
if (dtable.Rows.Count > 0)
{
Form3 newForm = new Form3();
newForm.Show();
}
else
{
MessageBox.Show("Invalid");
}
}
else if (radioButton2.Checked == true)
{
String querry = "SELECT * FROM Модераторы WHERE почта = '" + textBox1.Text + "' AND пароль = '" + textBox2.Text + "'";
SqlDataAdapter sda = new SqlDataAdapter(querry, conn);
DataTable dtable = new DataTable();
sda.Fill(dtable);
if (dtable.Rows.Count > 0)
{
Form4 newForm = new Form4();
newForm.Show();
}
else
{
MessageBox.Show("Invalid");
}
}
else if (radioButton3.Checked == true)
{
String querry = "SELECT * FROM Жюри WHERE почта = '" + textBox1.Text + "' AND пароль = '" + textBox2.Text + "'";
SqlDataAdapter sda = new SqlDataAdapter(querry, conn);
DataTable dtable = new DataTable();
sda.Fill(dtable);
if (dtable.Rows.Count > 0)
{
Form4 newForm = new Form4();
newForm.Show();
}
else
{
MessageBox.Show("Invalid");
}
}
else if (radioButton4.Checked == true)
{
String querry = "SELECT * FROM Организаторы WHERE Почта = '" + textBox1.Text + "' AND пароль = '" + textBox2.Text + "'";
SqlDataAdapter sda = new SqlDataAdapter(querry, conn);
DataTable dtable = new DataTable();
sda.Fill(dtable);
if (dtable.Rows.Count > 0)
{
SetValueForText1 = textBox1.Text;
SetValueForText2 = textBox2.Text;
Form5 newForm = new Form5();
newForm.Show();
this.Hide();
}
else
{
MessageBox.Show("Invalid");MessageBox.Show("Invalid");
}
}
else
{
MessageBox.Show("Invalid");
}
}
catch
{
MessageBox.Show("Er");
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
}
}
}
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace kod1._2_var6
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
}
}
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace kod1._2_var6
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
}
private void Form4_Load(object sender, EventArgs e)
{
}
}
}
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Drawing.Drawing2D;
namespace kod1._2_var6
{
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}
private void Form5_Load(object sender, EventArgs e)
{
if (DateTime.Now.Hour < 11)
{
label1.Text = "Доброе утро!";
}
else if (DateTime.Now.Hour < 18)
{
label1.Text = "Добрый день!";
}
else
{
label1.Text = "Добрый вечер!";
}
label2.Text = Login.SetValueForText1;
label3.Text = Login.SetValueForText2;
SqlConnection conn = new SqlConnection(@"Data Source=SERVER_BIT\SQLEXPRESS;Initial Catalog=sergutin_kod1.2;User ID=user1;Password=userdb1
");
String querry = "SELECT * FROM Организаторы WHERE Почта = '" + label2.Text + "' AND пароль = '" + label3.Text + "'";
SqlDataAdapter sda = new SqlDataAdapter(querry, conn);
DataTable dtable = new DataTable();
sda.Fill(dtable);
if (dtable.Rows.Count > 0)
{
object[] data = {dtable.Rows[0][0], dtable.Rows[0][7]};
label4.Text = data[0].ToString();
label5.Text = data[1].ToString();
if (label5.Text == "мужской")
{
label6.Text = "Mr";
}
else
{
label6.Text = "Mrs";
}
}
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
Form6 newForm = new Form6();
newForm.Show();
this.Hide();
}
}
}
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace kod1._2_var6
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void Form6_Load(object sender, EventArgs e)
{
//[EMAIL]tkgduj6na1hm@gmail.com[/EMAIL]
//JS4K8pr54u
/*Random rnd = new Random();
int randomnum = rnd.Next(0, 99999);
textBox1.Text = randomnum.ToString();
label1.Text = randomnum.ToString();*/
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
Random rnd = new Random();
int randomnum = rnd.Next(0, 99999);
textBox1.Text = randomnum.ToString();
label1.Text = randomnum.ToString();
}
}
}
Please accept this article. I need it to pass the exam, after which I am ready to delete it. I was very grateful, because this will decide the fate of my red diploma.
Last edited by a moderator: