private void Save() { try { var messageError = ""; if (string.IsNullOrEmpty(txtDescripcion.Text)) { messageError += "La descripcion campo obligatorio \n"; } if (string.IsNullOrEmpty(txtDireccion.Text)) { messageError += "La direccion campo obligatorio \n"; } if (!string.IsNullOrEmpty(messageError)) { LblMensaje.Text = messageError; return; } TBL_DEPARTAMENTO depart = new TBL_DEPARTAMENTO(); depart.DEP_DESCRIPCION = txtDescripcion.Text.ToUpper(); depart.DEP_DIRECCION = txtDireccion.Text.ToUpper(); LogicaDepartamento.saveDepartamentos(depart); LblMensaje.Text = "Registro Guardado Correctamente"; } catch (Exception ex) { LblMensaje.Text = ex.Message; } }
public void cargarDepartamento() { lgDepartamento = new LogicaDepartamento(); dtDepartamento.DataSource = lgDepartamento.DataTableDpto(); dtDepartamento.DataTextField = "departamento"; dtDepartamento.DataValueField = "id_departamento"; dtDepartamento.DataBind(); }
private void cargarDepto() { LogicaDepartamento lgDpto = new LogicaDepartamento(); dlDpto.DataSource = lgDpto.DataTableDpto(); dlDpto.DataTextField = "departamento"; dlDpto.DataValueField = "id_departamento"; dlDpto.DataBind(); }