private void Guardar() { String NOMBRE = TextBox_NombreDocumento.Text; DocumentoEntregable _documento = new DocumentoEntregable(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Decimal ID_DOCUMENTO = _documento.AdicionarRegistro(NOMBRE); if (ID_DOCUMENTO <= 0) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _documento.MensajeError, Proceso.Error); } else { Ocultar(Acciones.Inicio); Desactivar(Acciones.Inicio); Mostrar(Acciones.Inicio); Cargar(Acciones.Inicio); Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "El Documento fue registrado correctamente.", Proceso.Correcto); } }
private void cargar_GridView_RESULTADOS_BUSQUEDA() { DocumentoEntregable _documento = new DocumentoEntregable(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaDoc = _documento.ObtenerTodos(); if (tablaDoc.Rows.Count <= 0) { if (_documento.MensajeError == null) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontraron registros.", Proceso.Advertencia); } else { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _documento.MensajeError, Proceso.Error); } Panel_RESULTADOS_GRID.Visible = false; } else { GridView_RESULTADOS_BUSQUEDA.DataSource = tablaDoc; GridView_RESULTADOS_BUSQUEDA.DataBind(); } }
private void Actualizar() { Decimal ID_DOCUMENTO = Convert.ToDecimal(HiddenField_ID_DOCUMENTO.Value); String NOMBRE = TextBox_NombreDocumento.Text; Boolean ACTIVO = false; if (DropDownList_EstadoDocumento.SelectedValue == "True") { ACTIVO = true; } DocumentoEntregable _documento = new DocumentoEntregable(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); Boolean verificado = _documento.Actualizar(ID_DOCUMENTO, NOMBRE, ACTIVO); if (verificado == false) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _documento.MensajeError, Proceso.Error); } else { Ocultar(Acciones.Inicio); Desactivar(Acciones.Inicio); Mostrar(Acciones.Inicio); Cargar(Acciones.Inicio); Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La actualización se realizó correctamente.", Proceso.Correcto); } }
private void Cargar(Decimal ID_DOCUMENTO) { HiddenField_ID_DOCUMENTO.Value = ID_DOCUMENTO.ToString(); DocumentoEntregable _documento = new DocumentoEntregable(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaDoc = _documento.ObtenerPorId(ID_DOCUMENTO); if (tablaDoc.Rows.Count <= 0) { if (_documento.MensajeError != null) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _documento.MensajeError, Proceso.Error); } else { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información del documento seleccionado.", Proceso.Advertencia); } } else { DataRow filaDoc = tablaDoc.Rows[0]; CargarControlRegistro(filaDoc); TextBox_NombreDocumento.Text = filaDoc["NOMBRE"].ToString().Trim(); Cargar_DropDownList_EstadoDocumento(DropDownList_EstadoDocumento); DropDownList_EstadoDocumento.SelectedValue = filaDoc["ACTIVO"].ToString().Trim(); } }
private void Cargar_ChecksDeDocumentosEntregablesAlTrabajador(String documentosSeleccionados) { String[] listaDocumentosSeleccionados = documentosSeleccionados.Split('•'); CheckBoxList_Documentos1.Items.Clear(); CheckBoxList_Documentos2.Items.Clear(); CheckBoxList_Documentos3.Items.Clear(); CheckBoxList_Documentos4.Items.Clear(); CheckBoxList_Documentos5.Items.Clear(); DocumentoEntregable _documento = new DocumentoEntregable(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaDoc = _documento.ObtenerPorEstado(true); if (tablaDoc.Rows.Count <= 0) { if (_documento.MensajeError != null) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _documento.MensajeError, Proceso.Error); } else { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se ha creado la lista de Documentos Entregables al Trabajador.", Proceso.Advertencia); } } else { for (int i = 0; i < tablaDoc.Rows.Count; i++) { DataRow filaDoc = tablaDoc.Rows[i]; System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(filaDoc["NOMBRE"].ToString().Trim(), filaDoc["NOMBRE"].ToString().Trim()); item.Selected = ItemEnLista(listaDocumentosSeleccionados, item); if (i <= 10) { CheckBoxList_Documentos1.Items.Add(item); } if ((i > 10) && (i <= 20)) { CheckBoxList_Documentos2.Items.Add(item); } if ((i > 20) && (i <= 30)) { CheckBoxList_Documentos3.Items.Add(item); } if ((i > 30) && (i <= 40)) { CheckBoxList_Documentos4.Items.Add(item); } if ((i > 40) && (i <= 50)) { CheckBoxList_Documentos5.Items.Add(item); } } } }