1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 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 Zakaz : 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 Zakaz()
- {
- InitializeComponent();
- label1.Text = familia + " " + ima + " " + othestvo;
- const string sql = "SELECT * From zakaz_view where Статус = 'Делается'";
- 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 Zakaz_Load(object sender, EventArgs e)
- {
- }
- private void label1_Click(object sender, EventArgs e)
- {
-
-
- }
- 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();
- Izmenie.Sdelano jl = new Izmenie.Sdelano();
- string[] opisanie = new string[1];
- 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.Sdelano.id = opisanie[0];
- }
- using (Izmenie.Sdelano fl = new Izmenie.Sdelano())
- {
- this.Hide();
- fl.ShowDialog();
- this.Close();
- }
- }
- private void panel1_Paint(object sender, PaintEventArgs e)
- {
- }
- }
- }
|