Form3.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. namespace WindowsFormsApp22222
  11. {
  12. public partial class Form3 : Form
  13. {
  14. public Form3()
  15. {
  16. InitializeComponent();
  17. }
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. var db = new rewqEntities();
  21. var data = new Users
  22. {
  23. Email = textBox1.Text,
  24. FirstName = textBox2.Text,
  25. LastName = textBox3.Text,
  26. OfficeID = int.Parse(comboBox1.Text),
  27. Birthdate = DateTime.Parse(textBox4.Text),
  28. Password = textBox5.Text,
  29. RoleID = int.Parse(textBox6.Text)
  30. };
  31. db.Users.InsertOnSubmit(data);
  32. db.SubmitChanges();
  33. }
  34. private void button2_Click(object sender, EventArgs e)
  35. {
  36. Close();
  37. }
  38. }
  39. }