public ListarDepartamentos(string pais, Form parent) { InitializeComponent(); Loaddata(UsuariosBAL.Instance.GetDepartamentos(pais)); _parent = parent; _pais = pais; paisSeleccionado = DbContext.Instance.Find <DAL.Models.Paises>($"Select * from Paises where Id={_pais}"); this.txtTitle.Text = "Pais: "; this.textBox1.Text = paisSeleccionado.Nombre; }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtNombre.Text)) { return; } DAL.Models.Paises p = new DAL.Models.Paises(); p.Nombre = txtNombre.Text; DbContext.Instance.Add(p); DoAction.Invoke(UsuariosBAL.Instance.GetAllPaises()); this.Close(); }