private void CargarCMB() { DAL.TiposPersonasDAL tpDAL = new FrbaCommerce.DAL.TiposPersonasDAL(); DataTable dt = tpDAL.obtenerTiposPersonas(); DataRow dr = dt.NewRow(); dr["IdTipoPersona"] = -1; dr["Descripcion"] = "Todos"; dt.Rows.InsertAt(dr, 0); cmbTipoPersona.DisplayMember = "Descripcion"; cmbTipoPersona.ValueMember = "IdTipoPersona"; cmbTipoPersona.DataSource = dt; }
private void RegistroUsuario_Load(object sender, EventArgs e) { try { DAL.TiposPersonasDAL tpDAL = new FrbaCommerce.DAL.TiposPersonasDAL(); DAL.TiposDocumentosDAL tdDAL = new FrbaCommerce.DAL.TiposDocumentosDAL(); cmbTiposPersona.DisplayMember = "Descripcion"; cmbTiposPersona.ValueMember = "IdTipoPersona"; cmbTiposPersona.DataSource = tpDAL.obtenerTiposPersonas(); DataTable dt = tdDAL.obtenerTiposDocumentos(); DataRow dr = dt.NewRow(); dr["IdTipoDocumento"] = -1; dr["Descripcion"] = "Elegir"; dt.Rows.InsertAt(dr, 0); cmbTipoDocumento.DisplayMember = "Descripcion"; cmbTipoDocumento.ValueMember = "IdTipoDocumento"; cmbTipoDocumento.DataSource = dt; this.cargarListaRoles(); txtFechaNac.Enabled = false; mcFecha.Visible = false; mcFecha.SelectionRange.Start = Controller.Validaciones.ObtenerFechaSistema(); mcFecha.SelectionRange.End = Controller.Validaciones.ObtenerFechaSistema(); mcFecha.MaxDate = Controller.Validaciones.ObtenerFechaSistema(); mcFecha.TodayDate = Controller.Validaciones.ObtenerFechaSistema(); } catch (Exception ex) { View.Error.ErrorForm vtnError = new FrbaCommerce.View.Error.ErrorForm(ex.Message); vtnError.Visible = true; } }