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 Blanki_ekzamena { public partial class Operator : Form { public static string familia; public static string ima; public static string othestvo; public static string predmet; public static string gorod; public static string raion; public static string ych; public static string blank; public static string vid; public static string status; public Operator() { InitializeComponent(); label1.Text = familia + " " + ima + " " + othestvo + " - Оператор"; const string sql = "SELECT * From zakaz_view where Статус = 'Делается' OR Статус = 'Готово'"; using (SqlCommand sqlCommand = new SqlCommand(sql, DataBase.connect())) { try { using (SqlDataReader dataReader = sqlCommand.ExecuteReader()) { DataTable dataTable = new DataTable(); dataTable.Load(dataReader); this.dataGridView1.DataSource = dataTable; dataReader.Close(); } } catch { MessageBox.Show("Ошибка подключения"); } } } private void panel1_Paint(object sender, PaintEventArgs e) { } private void Operator_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { using (Vnytri.zakaz fd = new Vnytri.zakaz()) { this.Hide(); fd.ShowDialog(); this.Close(); } } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { predmet = dataGridView1.CurrentRow.Cells[0].Value.ToString(); gorod = dataGridView1.CurrentRow.Cells[1].Value.ToString(); raion = dataGridView1.CurrentRow.Cells[2].Value.ToString(); ych = dataGridView1.CurrentRow.Cells[3].Value.ToString(); blank = dataGridView1.CurrentRow.Cells[4].Value.ToString(); vid = dataGridView1.CurrentRow.Cells[5].Value.ToString(); status = dataGridView1.CurrentRow.Cells[6].Value.ToString(); Operator jl = new Operator(); string[] opisanie = new string[1]; if (status == "Готово") { using (SqlConnection connection = new SqlConnection("server=ngknn.ru;Trusted_Connection=No;DataBase=31P_Trifonova_PP;User ID=31П;PWD=12357")) { connection.Open(); SqlCommand command8 = new SqlCommand("select [id_table] from [dbo].[Zakaz] where [Predmet] ='" + predmet + "' and [Gorod] = '" + gorod + "'and [Raion]='" + raion + "'and [Uchebnoye_uchrezhdeniye] ='" + ych + "'and [Blank] ='" + blank + "'and [Kol_vo] ='" + vid + "' and [Statys] ='Готово'", connection); opisanie[0] = command8.ExecuteScalar().ToString(); Izmenie.Gotovo.id = opisanie[0]; } using (Izmenie.Gotovo fl = new Izmenie.Gotovo()) { this.Hide(); fl.ShowDialog(); this.Close(); } } else { MessageBox.Show("Данный бланк еще не готов", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }