private void button1_Click(object sender, EventArgs e) { try { User_access addAccess = new User_access { login = login.Text, password = password.Text, type = type.Text, status = status.Text, id_subsidiary_companies_region = this.id_region, date_up = DateTime.Now }; db.User_access.Add(addAccess); db.SaveChanges(); refreshModel(); } catch { MessageBox.Show("Заполните поля"); } }
public Main(User_access user) { InitializeComponent(); db = new ConnectContext((new ConfigJson()).StringConnecting()); this.user = user; }