Sdelano.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 Sdelano : Form
  14. {
  15. public static string id;
  16. public Sdelano()
  17. {
  18. InitializeComponent();
  19. label4.Text = Zakaz.predmet;
  20. label2.Text = Zakaz.gorod;
  21. label7.Text = Zakaz.raion;
  22. label5.Text = Zakaz.ych;
  23. label12.Text = Zakaz.blank;
  24. label9.Text = Zakaz.vid;
  25. }
  26. private void btn_soxr_Click(object sender, EventArgs e)
  27. {
  28. using (Zakaz fl = new Zakaz())
  29. {
  30. this.Hide();
  31. fl.ShowDialog();
  32. this.Close();
  33. }
  34. }
  35. private void button1_Click(object sender, EventArgs e)
  36. {
  37. const string sql = "UPDATE [Zakaz] SET Statys = 'Готово' WHERE id_table = @id";
  38. DataTable table = new DataTable();
  39. SqlCommand cmd = new SqlCommand(sql, DataBase.connect());
  40. SqlDataAdapter adapter = new SqlDataAdapter();
  41. cmd.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, 50));
  42. cmd.Parameters["@id"].Value = id;
  43. adapter.SelectCommand = cmd;
  44. adapter.Fill(table);
  45. using (Zakaz fl = new Zakaz())
  46. {
  47. this.Hide();
  48. fl.ShowDialog();
  49. this.Close();
  50. }
  51. }
  52. private void Sdelano_Load(object sender, EventArgs e)
  53. {
  54. }
  55. }
  56. }