Gotovo.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Data.SqlClient;
  11. namespace Blanki_ekzamena.Izmenie
  12. {
  13. public partial class Gotovo : Form
  14. {
  15. public static string id;
  16. public Gotovo()
  17. {
  18. InitializeComponent();
  19. label4.Text = Operator.predmet;
  20. label2.Text = Operator.gorod;
  21. label7.Text = Operator.raion;
  22. label5.Text = Operator.ych;
  23. label12.Text = Operator.blank;
  24. label9.Text=Operator.vid;
  25. }
  26. private void label10_Click(object sender, EventArgs e)
  27. {
  28. }
  29. private void label4_Click(object sender, EventArgs e)
  30. {
  31. }
  32. private void label6_Click(object sender, EventArgs e)
  33. {
  34. }
  35. private void label5_Click(object sender, EventArgs e)
  36. {
  37. }
  38. private void btn_soxr_Click(object sender, EventArgs e)
  39. {
  40. using (Operator fl = new Operator())
  41. {
  42. this.Hide();
  43. fl.ShowDialog();
  44. this.Close();
  45. }
  46. }
  47. private void button1_Click(object sender, EventArgs e)
  48. {
  49. const string sql = "UPDATE [Zakaz] SET Statys = 'Отдан' WHERE id_table = @id";
  50. DataTable table = new DataTable();
  51. SqlCommand cmd = new SqlCommand(sql, DataBase.connect());
  52. SqlDataAdapter adapter = new SqlDataAdapter();
  53. cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, 50));
  54. cmd.Parameters["@id"].Value = id;
  55. adapter.SelectCommand = cmd;
  56. adapter.Fill(table);
  57. using (Operator fl = new Operator())
  58. {
  59. this.Hide();
  60. fl.ShowDialog();
  61. this.Close();
  62. }
  63. }
  64. }
  65. }