1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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;
- namespace WindowsFormsApp22222
- {
- public partial class Form4 : Form
- {
- public Form4()
- {
- InitializeComponent();
- }
- public int Checked_RoleID { get; private set; }
- private void button1_Click(object sender, EventArgs e)
- {
- var db = new rewqEntities();
- if (radioButton1.Checked == true)
- {
- Checked_RoleID = 1;
- }
- else if (radioButton2.Checked == true)
- {
- Checked_RoleID = 2;
- }
- var data = new Users
- {
- Email = textBox1.Text,
- FirstName = textBox2.Text,
- LastName = textBox3.Text,
- OfficeID = int.Parse(comboBox1.Text),
- RoleID = Checked_RoleID,
- };
- db.Users.InsertOnSubmit(data);
- db.SubmitChanges();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Close();
- }
- }
- }
|