protected void Buscar() { Ocultar(); fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable _dataTable = new DataTable(); switch (this.DropDownList_BUSCAR.SelectedValue) { case "NOMBRE": _dataTable = _fondoPensiones.ObtenerPorNombre(this.TextBox_BUSCAR.Text); break; } if (_dataTable.Rows.Count > 0) { GridView_RESULTADOS_BUSQUEDA.DataSource = _dataTable; GridView_RESULTADOS_BUSQUEDA.DataBind(); Mostrar(Acciones.BusquedaEncontro); } else { if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error); else Informar(Label_MENSAJE, "ADVERTENCIA: No se encontró información para " + this.DropDownList_BUSCAR.SelectedItem + " : " + this.TextBox_BUSCAR.Text, Proceso.Correcto); Mostrar(Acciones.BusquedaNoEncontro); } _dataTable.Dispose(); }
private void cargar_DropDownList_ENTIDAD_AFP() { DropDownList_AFP.Items.Clear(); fondoPensiones _AFP = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaRegionales = _AFP.ObtenerTodosLosFondosDePensiones(); ListItem item = new ListItem("Seleccione...", ""); DropDownList_AFP.Items.Add(item); item = new ListItem("Ninguna", "0"); DropDownList_AFP.Items.Add(item); foreach (DataRow fila in tablaRegionales.Rows) { item = new ListItem(fila["NOM_ENTIDAD"].ToString(), fila["ID_F_PENSIONES"].ToString()); DropDownList_AFP.Items.Add(item); } DropDownList_AFP.DataBind(); DropDownList_AFP.Enabled = true; }
private void Guardar() { fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID = _fondoPensiones.Adicionar(TextBox_NIT.Text, TextBox_DV.Text, this.TextBox_COD_ENTIDAD.Text, TextBox_NOM_ENTIDAD.Text, TextBox_DIR_ENTIDAD.Text, TextBox_TEL_ENTIDAD.Text, TextBox_CONTACTO.Text, TextBox_CARGO.Text); if (ID == 0) { if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error); } else { Informar(Label_MENSAJE, "La entidad fue creada correctamente y se le asignó el ID: " + ID.ToString() + ".", Proceso.Correcto); TextBox_ID.Text = ID.ToString(); } Ocultar(); Mostrar(Acciones.Guarda); Bloquear(Acciones.Guarda); }
private void Modificar() { fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); if (_fondoPensiones.Actualizar(Convert.ToDecimal(this.TextBox_ID.Text), TextBox_NIT.Text, TextBox_DV.Text, this.TextBox_COD_ENTIDAD.Text, TextBox_NOM_ENTIDAD.Text, TextBox_DIR_ENTIDAD.Text, TextBox_TEL_ENTIDAD.Text, TextBox_CONTACTO.Text, TextBox_CARGO.Text, CheckBox_ESTADO.Checked)) { if (!String.IsNullOrEmpty(_fondoPensiones.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _fondoPensiones.MensajeError, Proceso.Error); } else { Informar(Label_MENSAJE, "La entidad fue actualizada correctamente.", Proceso.Correcto); TextBox_ID.Text = ID.ToString(); } Ocultar(); Mostrar(Acciones.Modifica); Bloquear(Acciones.Modifica); }
protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e) { if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString())) { fondoPensiones _fondoPensiones = new fondoPensiones(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Cargar(_fondoPensiones.ObtenerPorIdAFP(Convert.ToDecimal(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString()))); } Ocultar(); Mostrar(Acciones.Visualiza); Bloquear(Acciones.Visualiza); }