Menu.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.Windows.Forms;
  9. using System.Data.SqlClient;
  10. namespace Khozeev8
  11. {
  12. public partial class Menu : Form
  13. {
  14. Database database = new Database();
  15. public Menu()
  16. {
  17. InitializeComponent();
  18. StartPosition = FormStartPosition.CenterScreen;
  19. }
  20. private void Menu_Load(object sender, EventArgs e)
  21. {
  22. }
  23. private void button1_Click(object sender, EventArgs e)
  24. {
  25. var Name = textBox1.Text;
  26. var Colvo = textBox2.Text;
  27. var Type = textBox3.Text;
  28. var Cost = textBox4.Text;
  29. string querystring = $"insert into Комплектующие(Наименование, Количество,ТипДетали,Цена) values ('{Name}' , '{Colvo}', '{Type}','{Cost}')";
  30. SqlCommand command = new SqlCommand(querystring, database.GetConnection());
  31. }
  32. private void button2_Click(object sender, EventArgs e)
  33. {
  34. Aithorization frm = new Aithorization();
  35. this.Hide();
  36. frm.Show();
  37. }
  38. }
  39. }