protected void Buscar() { Ocultar(); eps _eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable _dataTable = new DataTable(); switch (this.DropDownList_BUSCAR.SelectedValue) { case "NOMBRE": _dataTable = _eps.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(_eps.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _eps.MensajeError, Proceso.Error); else Informar(Label_MENSAJE, "ADVERTENCIA: No se encontró información para " + this.DropDownList_BUSCAR.SelectedItem + " : " + this.TextBox_BUSCAR.Text, Proceso.Error); Mostrar(Acciones.BusquedaNoEncontro); } _dataTable.Dispose(); }
private void Cargar(GridView gridView) { if (gridView.Rows.Count > 0) { DataTable dataTable; DataRow dataRow; if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["NUM_CONTRATO"].ToString())) this.TextBox_NUM_CONTRATO.Text = this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["NUM_CONTRATO"].ToString(); if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[2].Text)) { this.TextBox_ID_EMPLEADO.Text = this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[2].Text; eps Eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); dataTable = Eps.ObtenerPorEPSPorIdEmpleado(Convert.ToDecimal(TextBox_ID_EMPLEADO.Text)); if (!dataTable.Rows.Count.Equals(0)) { dataRow = dataTable.Rows[0]; if (!string.IsNullOrEmpty(dataRow["NOM_ENTIDAD"].ToString())) TextBox_EPS.Text = dataRow["NOM_ENTIDAD"].ToString(); } arp Arp = new arp(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); dataTable = Arp.ObtenerPorARLPorIdEmpleado(Convert.ToDecimal(TextBox_ID_EMPLEADO.Text)); if (!dataTable.Rows.Count.Equals(0)) { dataRow = dataTable.Rows[0]; if (!string.IsNullOrEmpty(dataRow["NOM_ENTIDAD"].ToString())) TextBox_ARL.Text = dataRow["NOM_ENTIDAD"].ToString(); } } if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[3].Text)) this.TextBox_fecha_ingreso.Text = this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[3].Text; if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[4].Text)) this.TextBox_fecha_retiro.Text = HttpUtility.HtmlDecode(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[4].Text); if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[6].Text)) this.TextBox_ACTIVO.Text = this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[7].Text; if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[7].Text)) this.TextBox_APELLIDOS.Text = HttpUtility.HtmlDecode(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[8].Text); if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[8].Text)) this.TextBox_NOMBRES.Text = HttpUtility.HtmlDecode(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[9].Text); if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[9].Text)) this.TextBox_NUM_DOC_IDENTIDAD.Text = this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[10].Text; if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[10].Text)) this.TextBox_RAZ_SOCIAL.Text = HttpUtility.HtmlDecode(this.GridView_RESULTADOS_BUSQUEDA.SelectedRow.Cells[11].Text); } }
private void cargar_DropDownList_ENTIDAD_EPS() { DropDownList_ENTIDAD_EPS.Items.Clear(); eps _eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaRegionales = _eps.ObtenerTodasLasEPS(); ListItem item = new ListItem("Seleccione...", ""); DropDownList_ENTIDAD_EPS.Items.Add(item); foreach (DataRow fila in tablaRegionales.Rows) { item = new ListItem(fila["NOM_ENTIDAD"].ToString(), fila["ID_EPS"].ToString()); DropDownList_ENTIDAD_EPS.Items.Add(item); } DropDownList_ENTIDAD_EPS.DataBind(); DropDownList_ENTIDAD_EPS.Enabled = true; }
private void Modificar() { eps _eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); if (_eps.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(_eps.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _eps.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); }
private void Guardar() { eps _eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID = _eps.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(_eps.MensajeError)) Informar(Label_MENSAJE, "Error: Consulte con el Administrador: " + _eps.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); }
protected void GridView_RESULTADOS_BUSQUEDA_SelectedIndexChanged(object sender, EventArgs e) { if (!String.IsNullOrEmpty(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString())) { eps _eps = new eps(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Cargar(_eps.ObtenerPorIdEPS(Convert.ToDecimal(this.GridView_RESULTADOS_BUSQUEDA.SelectedDataKey["id"].ToString()))); } Ocultar(); Mostrar(Acciones.Visualiza); Bloquear(Acciones.Visualiza); }