From 40e428841bf92a8a6d9e9482b9d32d4bffe07fe0 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 31 Mar 2020 19:25:13 -0700 Subject: [PATCH 1/8] - cuenta concepto 313 --- App_Code/Modelos.vb | 2 -- 1 file changed, 2 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index fe9532a54..d45920d09 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2986,8 +2986,6 @@ Namespace Modelos If ObjConta.DtResultados.Rows.Count > 0 Then 'Conta ContPAQ IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero - 'Conta SIG - CveCuenta = ObjConta.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero End If End If From f049d3e4cfc2c91a007c45fc13625669ca70c317 Mon Sep 17 00:00:00 2001 From: Julian Moreno Date: Wed, 1 Apr 2020 13:30:20 -0700 Subject: [PATCH 2/8] prueba --- Inicio.aspx.vb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index eca249ee9..1a0b9ad1a 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -55,6 +55,9 @@ Partial Class Inicio Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then + If True Then + Dim x = "" + End If 'Reporte de ventas sin registrar sig If UsuarioActual.TienePermisoProceso(287) Then From ff129fcb4678c362e07e406b6b4548b89a92369f Mon Sep 17 00:00:00 2001 From: Julian Moreno Date: Wed, 1 Apr 2020 13:53:06 -0700 Subject: [PATCH 3/8] Prueba JM --- Inicio.aspx.vb | 2135 ++++++++++++++++++++++++------------------------ 1 file changed, 1067 insertions(+), 1068 deletions(-) diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index a8cc8ee2e..29ed2e629 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -1,16 +1,16 @@ -Imports System.Data -Imports System.Globalization -Imports Extensiones -Imports System.Web.Services -Imports Newtonsoft.Json -Imports System.Drawing - -'Imports System.Reflection -'Imports Telerik.Web.UI - -Partial Class Inicio - Inherits ClsPaginas - +Imports System.Data +Imports System.Globalization +Imports Extensiones +Imports System.Web.Services +Imports Newtonsoft.Json +Imports System.Drawing + +'Imports System.Reflection +'Imports Telerik.Web.UI + +Partial Class Inicio + Inherits ClsPaginas + Private Dias() As String = {"Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"} @@ -51,12 +51,11 @@ Partial Class Inicio Me.OnError("Error al obtener cancelaciones pendientes: ", ex, "") End Try Return retorno - End Function - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + End Function + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then - 'Hola caudillo - 'Dim obj2 As Object() = CType(obj.[GetType]().GetField("_caches", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance).GetValue(obj), Object()) + If Not IsNothing(Request("logout")) AndAlso Request("logout").ToString() = "1" Then Usuario.CerrarSession() Exit Sub @@ -74,7 +73,7 @@ Partial Class Inicio End Using GvFoliosSAT.DataBind() End If - 'Reporte de ventas pendientes de cancelar + 'Reporte de ventas pendientes de cancelar If UsuarioActual.TienePermisoProceso(288) Then Using objventas As New ClsVentas If (GetFacturasCanceladasPendientesWS(objventas, UsuarioActual.Empresa.RFC, UsuarioActual.CveEmpresa, False)) AndAlso objventas.DtResultados.Rows.Count > 0 Then @@ -85,70 +84,70 @@ Partial Class Inicio End If 'RESTRICCION AD - If Not IsNothing(Request("ADCod")) Then - 'viene el msg encriptado, para sacar el modulo - Dim Codigo As String = Decripta(Request("ADCod")) - Dim Msg As String = "" - If Codigo.Substring(0, 10) = "CveModulo=" Then - Msg = "No tiene permisos de acceso al módulo:" & GlobalDTModulos().FiltroPrimeroValor("Modulo", Codigo) - End If - Alert(Msg, TipoMensaje.MsgAdvertencia) - End If - - 'tiene prioridad que cambie de contrase;a primero antes de redireccionar a su pagina - If UsuarioActual.Contraseña = (ContraseñaPredeterminadaEncriptada) OrElse UsuarioActual.ActCambiarContraseña Then - Response.Redirect("/Sistemas/CatContrasenia.aspx") - End If - - If UsuarioActual.Portal Then - Response.Redirect("/Portal/ConsultaCliente.aspx") - End If - - If UsuarioActual.CvePlataforma = 6 Then - Response.Redirect("/PortalCliente/PortalCliente.aspx") - End If - - If UsuarioActual.CvePlataforma = 7 Then - Response.Redirect("/PortalProveedor/PortalProveedor.aspx") - End If - - If UsuarioActual.CveEmpresa = 66 Then - LtlTitulo.Text = "Sistema Integral de Información Gluyas" - End If - - If UsuarioActual.Empresa.UsaContabilidad Then - Dim ObjPolizas As New ClsContPAQi(UsuarioActual.Empresa) - If ObjPolizas.GetPolizasCuadre() And ObjPolizas.DtResultados.Rows.Count > 0 Then - Dim ObjNotificacion = ItemNotificaciones(String.Format("Polizas de cuadre {0}", ObjPolizas.DtResultados.Rows.Count), Ico:="icon-calculator", Tipo:="warning", Link:="/Contabilidad/RepPolizasCuadre.aspx") - NotificacionesPendientes(ObjNotificacion) - End If - ObjPolizas.Dispose() - End If - - 'C A R G A - A L E R T A S - O R D E N E S D E C O M P R A - If UsuarioActual.CveUsuario <> 1459 Then - Dim OC As New ClsOC - If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then - If (OC.DtResultados.Rows.Count > 0) Then - Dim ObjNotificacion = ItemNotificaciones(String.Format("Orden de Compra por atender {0}", OC.DtResultados.Rows.Count), Ico:="fa fa-tags", Tipo:="warning", Link:="/OC/RepOC.aspx") - NotificacionesPendientes(ObjNotificacion) - End If - End If - OC.Dispose() - End If - - - ViewState("FechaSel") = Now.ToShortDateString - 'Not UsuarioActual.CveEmpresa.Contiene(66, 74) OrElse - - If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then - CargaGraficas() - End If - - CargaTareas() - If UsuarioActual.CveRol = 1 Then - divInd.Visible = True - CargaSubProyectos() + If Not IsNothing(Request("ADCod")) Then + 'viene el msg encriptado, para sacar el modulo + Dim Codigo As String = Decripta(Request("ADCod")) + Dim Msg As String = "" + If Codigo.Substring(0, 10) = "CveModulo=" Then + Msg = "No tiene permisos de acceso al módulo:" & GlobalDTModulos().FiltroPrimeroValor("Modulo", Codigo) + End If + Alert(Msg, TipoMensaje.MsgAdvertencia) + End If + + 'tiene prioridad que cambie de contrase;a primero antes de redireccionar a su pagina + If UsuarioActual.Contraseña = (ContraseñaPredeterminadaEncriptada) OrElse UsuarioActual.ActCambiarContraseña Then + Response.Redirect("/Sistemas/CatContrasenia.aspx") + End If + + If UsuarioActual.Portal Then + Response.Redirect("/Portal/ConsultaCliente.aspx") + End If + + If UsuarioActual.CvePlataforma = 6 Then + Response.Redirect("/PortalCliente/PortalCliente.aspx") + End If + + If UsuarioActual.CvePlataforma = 7 Then + Response.Redirect("/PortalProveedor/PortalProveedor.aspx") + End If + + If UsuarioActual.CveEmpresa = 66 Then + LtlTitulo.Text = "Sistema Integral de Información Gluyas" + End If + + If UsuarioActual.Empresa.UsaContabilidad Then + Dim ObjPolizas As New ClsContPAQi(UsuarioActual.Empresa) + If ObjPolizas.GetPolizasCuadre() And ObjPolizas.DtResultados.Rows.Count > 0 Then + Dim ObjNotificacion = ItemNotificaciones(String.Format("Polizas de cuadre {0}", ObjPolizas.DtResultados.Rows.Count), Ico:="icon-calculator", Tipo:="warning", Link:="/Contabilidad/RepPolizasCuadre.aspx") + NotificacionesPendientes(ObjNotificacion) + End If + ObjPolizas.Dispose() + End If + + 'C A R G A - A L E R T A S - O R D E N E S D E C O M P R A + If UsuarioActual.CveUsuario <> 1459 Then + Dim OC As New ClsOC + If OC.GetOrdenesPendientes("-1", 0, UsuarioActual.CveEmpresa, -1, -1, -1, UsuarioActual.CveUsuario, -1) Then + If (OC.DtResultados.Rows.Count > 0) Then + Dim ObjNotificacion = ItemNotificaciones(String.Format("Orden de Compra por atender {0}", OC.DtResultados.Rows.Count), Ico:="fa fa-tags", Tipo:="warning", Link:="/OC/RepOC.aspx") + NotificacionesPendientes(ObjNotificacion) + End If + End If + OC.Dispose() + End If + + + ViewState("FechaSel") = Now.ToShortDateString + 'Not UsuarioActual.CveEmpresa.Contiene(66, 74) OrElse + + If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then + CargaGraficas() + End If + + CargaTareas() + If UsuarioActual.CveRol = 1 Then + divInd.Visible = True + CargaSubProyectos() End If 'Ventas no timbradas por centro de costo @@ -160,1005 +159,1005 @@ Partial Class Inicio End If If UsuarioActual.TienePermisoProceso(271) Then MuestraVentasPUE() - If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE() - - Dim EsDEV = Not UsuarioActual.Empresa.FacturaProduccion - If Not EsDEV Then + If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE() + + Dim EsDEV = Not UsuarioActual.Empresa.FacturaProduccion + If Not EsDEV Then If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100 - End If - - 'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD - - InicializaCalendar() - - If UsuarioActual.CveEmpresa = 72 Then - DivDirectorioTelefonico.Visible = True - CargaDirectorioTelefonico() - Else - DivDirectorioTelefonico.Visible = False - End If - - 'CARGA COMUNICADO - If UsuarioActual.TienePermisoProceso(224) Then - LnkAgregar.Visible = True - End If - - CargaComunicado() - - 'Evaluacion del proveedor - CargaEvaluacionProveedor() - - End If - - End Sub - Private Sub CargaEvaluacionProveedor() - If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then - Dim ObjProveedor As New ClsCompProveedores - If ObjProveedor.GetEvaluacionesProveedores(-1, -1, UsuarioActual.CveEmpresa) Then - If ObjProveedor.DtResultados.COUNT("CveEvaluacionProveedor", $"Evaluado = 0 AND CveUsuario={UsuarioActual.CveUsuario}") > 0 Then - Dim Mensaje As String = "Hay evaluaciones de proveedores pendientes por aceptar. ¿Desea evaluar las evaluaciones de proveedor pendientes?" - Dim MsgAccionAceptar = "window.open(""/Compras/EvaluacionProveedor.aspx?CveProveedor=-1"");" - - Alert(Mensaje, TipoMensaje.MsgConfirmacion, JSBtnAceptar:=MsgAccionAceptar, TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") - End If - End If - ObjProveedor.Dispose() - End If - - End Sub - - Private Sub MuestraVentasPUE() - Dim objVentas As New ClsVentas + End If + + 'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD + + InicializaCalendar() + + If UsuarioActual.CveEmpresa = 72 Then + DivDirectorioTelefonico.Visible = True + CargaDirectorioTelefonico() + Else + DivDirectorioTelefonico.Visible = False + End If + + 'CARGA COMUNICADO + If UsuarioActual.TienePermisoProceso(224) Then + LnkAgregar.Visible = True + End If + + CargaComunicado() + + 'Evaluacion del proveedor + CargaEvaluacionProveedor() + + End If + + End Sub + Private Sub CargaEvaluacionProveedor() + If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then + Dim ObjProveedor As New ClsCompProveedores + If ObjProveedor.GetEvaluacionesProveedores(-1, -1, UsuarioActual.CveEmpresa) Then + If ObjProveedor.DtResultados.COUNT("CveEvaluacionProveedor", $"Evaluado = 0 AND CveUsuario={UsuarioActual.CveUsuario}") > 0 Then + Dim Mensaje As String = "Hay evaluaciones de proveedores pendientes por aceptar. ¿Desea evaluar las evaluaciones de proveedor pendientes?" + Dim MsgAccionAceptar = "window.open(""/Compras/EvaluacionProveedor.aspx?CveProveedor=-1"");" + + Alert(Mensaje, TipoMensaje.MsgConfirmacion, JSBtnAceptar:=MsgAccionAceptar, TextoConfirmacion:="    Si    ", TextoCancelacion:="    No    ") + End If + End If + ObjProveedor.Dispose() + End If + + End Sub + + Private Sub MuestraVentasPUE() + Dim objVentas As New ClsVentas Dim FechaInicio As Date = Now.AddYears(-2) LblVentasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString - If objVentas.GetPUESinPago(FechaInicio, Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then - If objVentas.DtResultados.Rows.Count > 0 Then - GvVtaPUE.DataSource = objVentas.DtResultados - - RegistraScript("$('#ModalVentasPUE').modal('show');", "showmodal4Incons") - End If - End If - - objVentas.Dispose() - GvVtaPUE.DataBind() - End Sub - - Private Sub MuestraComprasPUE() + If objVentas.GetPUESinPago(FechaInicio, Now, -1, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + If objVentas.DtResultados.Rows.Count > 0 Then + GvVtaPUE.DataSource = objVentas.DtResultados + + RegistraScript("$('#ModalVentasPUE').modal('show');", "showmodal4Incons") + End If + End If + + objVentas.Dispose() + GvVtaPUE.DataBind() + End Sub + + Private Sub MuestraComprasPUE() Dim objCompras As New ClsCompras Dim FechaInicio As Date = Now.AddYears(-2) - LblComprasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString - If objCompras.GetPUESinPago(FechaInicio, Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then - If objCompras.DtResultados.Rows.Count > 0 Then - GvCompPUE.DataSource = objCompras.DtResultados - - RegistraScript("$('#ModalComprasPUE').modal('show');", "showmodal3Incons") - End If - End If - - objCompras.Dispose() - GvCompPUE.DataBind() - End Sub - - Private Sub MuestraInconsistencias() - Dim ObjP As New ClsContabilidad - If ObjP.GetInconsistencias() Then - If ObjP.DtResultados.Rows.Count > 0 Then - LblInconsistenciasNum.Text = ObjP.DtResultados.Rows.Count - GvIncons.DataSource = ObjP.DtResultados - - RegistraScript("$('#ModalInconsistencias').modal('show');", "showmodalIncons") - End If - End If - - ObjP.Dispose() - GvIncons.DataBind() - End Sub - - Private Sub MuestraNoTimbradasCentroCosto() - Dim ObjSub As New ClsSubProyectos - If ObjSub.GetNoTimbradasCentroCosto(UsuarioActual.CveEmpresa) Then - If ObjSub.DtResultados.Rows.Count > 0 Then - LblNoTimbradas.Text = ObjSub.DtResultados.Rows.Count - GvNoTimbradasCentroCosto.DataSource = ObjSub.DtResultados - - RegistraScript("$('#ModalNoTimbradasCentroCosto').modal('show');", "showmodal2Incons") - End If - End If - ObjSub.Dispose() - GvNoTimbradasCentroCosto.DataBind() - End Sub - - Private Sub CargaSubProyectos() - DdlSubproyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubproyectos.DataBind() - DdlSubproyectos.Items.Insert(0, New ListItem("Todos", "-1")) - DdlSubproyectos.SelectedIndex = 0 - End Sub - - Private Sub CargaGraficas() - - ' sino tiene permisos, no genera trabajo - If Not (UsuarioActual.TienePermisoIndicador(1) OrElse UsuarioActual.TienePermisoIndicador(2) OrElse - UsuarioActual.TienePermisoIndicador(3) OrElse UsuarioActual.TienePermisoIndicador(4) OrElse - UsuarioActual.TienePermisoIndicador(5) OrElse UsuarioActual.TienePermisoIndicador(6) OrElse - UsuarioActual.TienePermisoIndicador(7) OrElse UsuarioActual.TienePermisoIndicador(8)) Then - Exit Sub - End If - - DivIndicadores.InnerHtml = "" - Dim dtIndicadores As DataTable = Nothing - Dim dtVentas As DataTable = Nothing - Dim dtBancos As DataTable = Nothing - Dim dtRH As DataTable = Nothing - Dim dtBancosCuentas As DataTable = Nothing - - Dim Gral As New ClsGenerales - Dim ds As DataSet = Gral.GetIndicadores(UsuarioActual.CveEmpresa) - - If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then - - dtIndicadores = ds.Tables(0) - dtBancos = ds.Tables(1) - dtBancosCuentas = ds.Tables(2) - dtVentas = ds.Tables(3) - dtRH = ds.Tables(4) - - Graficas.Visible = True - DivIndicadores.Visible = True - - End If - Gral.Dispose() - - If dtIndicadores IsNot Nothing AndAlso dtIndicadores.Rows.Count > 0 Then - - Dim dr As DataRow = dtIndicadores.Rows(0) - - Select Case DdlFiltroIndicador.SelectedValue - Case "Ger" - - - If UsuarioActual.TienePermisoIndicador(1) Then - MuestraIndicador(DivIndicadores, "blue", "fa fa-automobile", "Ventas", dr("TotalVentas").ToString.FormatoNumero(0), "/Ventas/RepVentas.aspx", "Mes actual", dr("TotalVentasAcumulado").ToString.FormatoNumero(0), "link", "Anual") - End If - - If UsuarioActual.TienePermisoIndicador(2) Then - MuestraIndicador(DivIndicadores, "red-intense", "fa fa-bar-chart-o", "Compras", dr("TotalCompras").ToString.FormatoNumero(0), "/Compras/RepCompras.aspx", "Total Compras", dr("CxPVencido").ToString.FormatoNumero(0), "link", "Saldo Vencido", dr("CxPPorVencer").ToString.FormatoNumero(0), "link", "Saldo por vencer") - End If - - If UsuarioActual.TienePermisoIndicador(3) Then - MuestraIndicador(DivIndicadores, "green-haze", "fa fa-shopping-cart", "Bancos", String.Format("${0}", dr("TotalBancos").ToString.FormatoNumero), "/Bancos/RepSaldos.aspx", "") - End If - - If UsuarioActual.TienePermisoIndicador(4) Then - MuestraIndicador(DivIndicadores, "purple-plum", "fa fa-globe", "Crédito", String.Format("${0}", dr("TotalCredito").ToString.FormatoNumero), "", "") - End If - - If UsuarioActual.TienePermisoIndicador(5) Then - MuestraIndicador(DivIndicadores, "yellow", "fa fa-globe", "Inventario", String.Format("${0}", dr("TotalAlmacen").ToString.FormatoNumero), "/Inventarios/RepAlmacen.aspx", "") - End If - - If UsuarioActual.TienePermisoIndicador(6) Then - MuestraIndicador(DivIndicadores, "grey-cascade", "fa fa-globe", "Impuestos", String.Format("${0}", dr("TotalImpuestos").ToString.FormatoNumero), "", "") - - End If - If UsuarioActual.TienePermisoIndicador(13) Then - MuestraIndicador(DivIndicadores, "blue", "fa fa-globe", "Orden Producción", String.Format("{0}%", dr("TotalPorcentaje").ToString.FormatoNumero), "/CGame/RepAvance.aspx?Opcion=1", "") - - End If - End Select - - If UsuarioActual.CveRol = 1 Then - - Select Case DdlFiltroIndicador.SelectedValue - Case "RH" - MuestraIndicador(DivIndicadores, "green-haze", "fa fa-bar-chart-o", "Plantilla", dr("RH_Personal_Total").ToString, "", "Total Personal", dr("RH_Personal_Adm").ToString.FormatoNumero(0), "link", "Per. Adm.", dr("RH_Personal_Guardia").ToString.FormatoNumero(0), "link", "Per. Guardia.") - MuestraIndicador(DivIndicadores, "grey-cascade", "fa fa-globe", "Faltas", dr("RH_FaltasAnual").ToString.FormatoNumero(0), "", "Anual", dr("RH_FaltasMensual").ToString.FormatoNumero(0), "link", "Faltas Mensual", dr("RH_FaltasDia").ToString.FormatoNumero(0), "link", "Faltas de hoy") - MuestraIndicador(DivIndicadores, "red-intense", "fa fa-globe", "Ausentismo", "8.23%", "", "") - MuestraIndicador(DivIndicadores, "purple-plum", "fa fa-globe", "Rotación", "18.23%", "", "") - MuestraIndicador(DivIndicadores, "yellow", "fa fa-globe", "Uniformes", "Diciembre: 29", "", "") - 'MuestraGrafica(div_RHInd1, dtRH, "Sucursal", "Personal", "", "", "gh21", "") - GeneraGraficaRH(dtRH, "Personal Requerido", "por centro de costo") - GeneraGraficaRH2(dtRH, "Personal Actual", "por centro de costo") - divGraficas1.Visible = True - Case "Ger" - MuestraIndicador(DivIndicadores, "green-haze", "fa fa-bar-chart-o", "Plantilla", dr("RH_Personal_Total").ToString, "", "Total Personal", dr("RH_Personal_Adm").ToString.FormatoNumero(0), "link", "Per. Adm.", dr("RH_Personal_Guardia").ToString.FormatoNumero(0), "link", "Per. Guardia.") - - End Select - - End If - - 'End If - - End If - - If UsuarioActual.TienePermisoIndicador(7) Then - DvGraVentas.Visible = True - MuestraGrafica(div_ventas, dtVentas, "NombreMes", "Importe", "", "", "gh2", "$M") - Else - DvGraVentas.Visible = False - End If - - If UsuarioActual.TienePermisoIndicador(8) Then - DvGraBancos.Visible = True - - If dtBancos IsNot Nothing Then - MuestraGrafica(div_bancos, dtBancos, dtBancosCuentas, "NombreMes", "Importe", "", "", "gh1", "$", dtBancos.AVG("Importe").ToString.FormatoNumero) - End If - Else - DvGraBancos.Visible = False - End If - - Select Case DdlFiltroIndicador.SelectedValue - Case "Ger" - DvGraBancos.Visible = True - DvGraVentas.Visible = True - DivRHInd.Visible = False - Case "RH" - DivRHInd.Visible = True - DvGraBancos.Visible = False - DvGraVentas.Visible = False - End Select - - dtIndicadores = Nothing - dtBancos = Nothing - dtBancosCuentas = Nothing - dtVentas = Nothing - dtRH = Nothing - - End Sub - - Private Sub GeneraGraficaRH(data As DataTable, Titulo As String, SubTitulo As String) - 'remueve la columna CveSucursal - data.Columns.RemoveAt(0) - - Dim json As String = ToJsonString(GraficaStandarB(data, "column", Titulo, $"
{SubTitulo}
", False)) - Dim json2 As String = ToJsonString(GraficaStandar(data, "column", Titulo, $"
{SubTitulo}
", True)) - 'Literal1.Text = json - RegistraScript(String.Format("function CargaGrafica() {{$('#{2}').highcharts({0});}}function CargaGrafica2() {{$('#{2}').highcharts({1});}} CargaGrafica();", json, json2, div_RHInd1.ClientID), "grh1") - - End Sub - - Private Sub GeneraGraficaRH2(data As DataTable, Titulo As String, SubTitulo As String) - 'remueve la columna CveSucursal - 'data.Columns.RemoveAt(0) - data.Columns.RemoveAt(2) - - Dim json As String = ToJsonString(GraficaStandarB(data, "column", Titulo, $"
{SubTitulo}
", False)) - 'Dim json2 As String = ToJsonString(GraficaStandar(data, "column", Titulo, $"
{SubTitulo}
", True)) - 'Literal1.Text = json - RegistraScript(String.Format("function CargaGrafica3() {{$('#{2}').highcharts({0});}}function CargaGrafica4() {{$('#{2}').highcharts({1});}} CargaGrafica3();", json, "", divRHGrafica2.ClientID), "grh2") - - End Sub - - Private Sub CargaTareas() - Dim ObjProspectos As New ClsOIEventos - - Dim FechaI, FechaF As DateTime - Dim CveEventoEstatus As Integer = -1 - FechaI = Now.AddDays(-180) - FechaF = Now - If ObjProspectos.GetRepEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, 1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF) Then - - Dim DT As DataTable = ObjProspectos.DtResultados.Clone - - If ChkOIPorHacer.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioPara = {0} ", UsuarioActual.CveUsuario))) - If ChkOIAsigne.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioDe = {0} ", UsuarioActual.CveUsuario))) - - GvT.DataSource = DT - End If - - ObjProspectos.Dispose() - GvT.DataBind() - End Sub - Protected Sub GvT_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvT.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - Select Case UsuarioActual.CveUsuario.ToString - Case e.Row.DBCampo("CveUsuarioPara") - 'etiqueta de 'asignado' - e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-warning " - e.Row.FCLabel("LblTipo").Text = "por hacer " - Case e.Row.DBCampo("CveUsuarioDe") - e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-success" - e.Row.FCLabel("LblTipo").Text = "Asigné" - End Select - End If - End Sub - Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String) - Dim htmldiv As New StringBuilder - htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) - htmldiv.AppendFormat("
{0}
Ver Más
", Link) - DIV.InnerHtml = htmldiv.ToString - End Sub - Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String) - Dim htmldiv As New StringBuilder - htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) - htmldiv.AppendFormat("
{0}
", Titulo) - htmldiv.AppendFormat("", CT1, C1) - htmldiv.AppendFormat("", CT2, C2) - htmldiv.Append("
Ver Más ") - htmldiv.AppendFormat("
") - DIV.InnerHtml = htmldiv.ToString - End Sub - Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String) - Dim htmldiv As New StringBuilder - htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) - htmldiv.AppendFormat("
{0}
", Titulo) - htmldiv.AppendFormat("", CT1, C1) - htmldiv.AppendFormat("", CT2, C2) - htmldiv.AppendFormat("", CT3, C3) - htmldiv.Append("
Ver Más ") - htmldiv.AppendFormat("
") - DIV.InnerHtml = htmldiv.ToString - End Sub - Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String, C4 As String, CL4 As String, CT4 As String) - Dim htmldiv As New StringBuilder - htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) - htmldiv.AppendFormat("
{0}
", Titulo, CT1, C1) - htmldiv.AppendFormat("", CT2, C2) - htmldiv.AppendFormat("", CT3, C3) - htmldiv.AppendFormat("", CT4, C4) - htmldiv.AppendFormat("
Ver Más
", CL1) - DIV.InnerHtml = htmldiv.ToString - End Sub - Private Sub MuestraGrafica(divcontainer As HtmlGenericControl, DTDatos As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Optional Indicador As String = "gh", Optional XReferencia As String = "", Optional YReferencia As String = "") - Dim Info As String = "" - Dim SBJSScript As New StringBuilder - If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then - For Each DbRow As DataRow In DTDatos.Rows - Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) - Next - Info = Info.Remove(Info.Length - 1, 1) - SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) - Else - SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia) - End If - RegistraScript(SBJSScript.ToString, Indicador) - End Sub - Private Sub MuestraGrafica(divcontainer As HtmlGenericControl, DTDatos As DataTable, DTPie As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Indicador As String, XReferencia As String, Promedio As String, Optional YReferencia As String = "") - Dim SBPie1 As New StringBuilder - Dim SBPie2 As New StringBuilder - Dim Info As String = "" - Dim SBJSScript As New StringBuilder - If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then - For Each DbRow As DataRow In DTDatos.Rows - Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) - Next - Info = Info.Remove(Info.Length - 1, 1) - End If - For Each DbRow As DataRow In DTPie.Rows - If DbRow("Importe").ToString.ToDouble > 0 Then SBPie1.AppendFormat("{{ name:'{1}- {2}',y:{0} }},", DbRow("Importe"), DbRow("Banco"), DbRow("NumCuenta")) - Next - - 'pesos y dolares - Dim Dolares As Double = DTPie.SUM("Importe", "CveMoneda = 2") - - If Dolares > 0 Then - SBPie2.AppendFormat("{{ name:'Dólares',y:{0} }},", Dolares) - SBPie2.AppendFormat("{{ name:'Pesos',y:{0} }},", DTPie.SUM("Importe", "CveMoneda = 1")) - End If - - If SBPie1.Length > 2 Then SBPie1 = SBPie1.Remove(SBPie1.Length - 1, 1) - If SBPie2.Length > 2 Then SBPie2 = SBPie2.Remove(SBPie2.Length - 1, 1) - SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, SBPie1, SBPie2) - - RegistraScript(SBJSScript.ToString, Indicador) - End Sub - Private Sub MuestraGrafica(DTDatos As DataTable, ColTitle As String, ColValue As String, TipoDato As String, DivId As String) - Dim Info As String = "" - If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then - For Each DbRow As DataRow In DTDatos.Rows - Info = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info) - Next - - Info = Info.Remove(Info.Length - 1, 1) - Dim SBJSScript As New StringBuilder - SBJSScript.AppendFormat("var datos=[{0}];graficaindex(datos,'{1}','{2}');", Info, DivId, TipoDato) - RegistraScript(SBJSScript.ToString, "g1") - End If - - End Sub - Private Sub MuestraGrafica(DTDatos As DataTable, DTDatos2 As DataTable, ColTitle As String, ColValue As String, TipoDato As String, DivId As String) - Dim Info As String = "" - Dim Info2 As String = "" - For Each DbRow As DataRow In DTDatos.Rows - Info = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info) - Next - For Each DbRow As DataRow In DTDatos2.Rows - Info2 = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info2) - Next - Info2 = Info2.Remove(Info2.Length - 1, 1) - Info = Info.Remove(Info.Length - 1, 1) - Dim SBJSScript As New StringBuilder - SBJSScript.AppendFormat("var datos=[{0}];var datos2=[{3}];graficaindex2(datos,'{1}','{2}',datos2);", Info, DivId, TipoDato, Info2) - RegistraScript(SBJSScript.ToString, "g2") - End Sub - Private Sub MuestraGraficaRM(divcontainer As HtmlGenericControl, DTDatos As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Optional Indicador As String = "gh", Optional XReferencia As String = "", Optional YReferencia As String = "") - Dim Info As String = "" - Dim SBJSScript As New StringBuilder - If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then - For Each DbRow As DataRow In DTDatos.Rows - Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) - Next - Info = Info.Remove(Info.Length - 1, 1) - SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) - Else - SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia) - End If - RegistraScript(SBJSScript.ToString, Indicador) - End Sub - Private Function CargaSesionesActivas() As String - Dim SBSesiones As New StringBuilder - Try - - Dim DicSesiones As Dictionary(Of String, HttpSessionState) = DirectCast(Application("s"), Dictionary(Of String, HttpSessionState)) - - If DicSesiones IsNot Nothing Then - For Each DicItem As KeyValuePair(Of String, HttpSessionState) In DicSesiones - 'gv.Add(New String() With { _ - ' Key .SessionId = item.Key, _ - ' Key .SessionKey = Nothing, _ - ' Key .SessionValue = Nothing _ - '}) - SBSesiones.Append(DicItem.Key) - If DicItem.Value IsNot Nothing AndAlso DicItem.Value.Count > 0 Then - For Each DicKey As String In DicItem.Value.Keys - SBSesiones.Append(DicItem.Key) - SBSesiones.Append(DicKey) - SBSesiones.Append(If(DicItem.Value(DicKey) IsNot Nothing, DicItem.Value(DicKey).ToString(), String.Empty)) - 'gv.Add(New String() With { _ - ' Key .SessionId = item.Key, _ - ' Key .SessionKey = key, _ - ' Key .SessionValue = If(item.Value(key) IsNot Nothing, item.Value(key).ToString(), String.Empty) _ - '}) - Next - End If - SBSesiones.Append("
") - Next - - 'sessionValuesGrid.DataSource = gv - 'sessionValuesGrid.DataBind() - End If - Catch - End Try - Return SBSesiones.ToString + LblComprasPUE.Text = "Facturas apartir de " & FechaInicio.ToShortDateString + If objCompras.GetPUESinPago(FechaInicio, Now, -1, -1, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then + If objCompras.DtResultados.Rows.Count > 0 Then + GvCompPUE.DataSource = objCompras.DtResultados + + RegistraScript("$('#ModalComprasPUE').modal('show');", "showmodal3Incons") + End If + End If + + objCompras.Dispose() + GvCompPUE.DataBind() + End Sub + + Private Sub MuestraInconsistencias() + Dim ObjP As New ClsContabilidad + If ObjP.GetInconsistencias() Then + If ObjP.DtResultados.Rows.Count > 0 Then + LblInconsistenciasNum.Text = ObjP.DtResultados.Rows.Count + GvIncons.DataSource = ObjP.DtResultados + + RegistraScript("$('#ModalInconsistencias').modal('show');", "showmodalIncons") + End If + End If + + ObjP.Dispose() + GvIncons.DataBind() + End Sub + + Private Sub MuestraNoTimbradasCentroCosto() + Dim ObjSub As New ClsSubProyectos + If ObjSub.GetNoTimbradasCentroCosto(UsuarioActual.CveEmpresa) Then + If ObjSub.DtResultados.Rows.Count > 0 Then + LblNoTimbradas.Text = ObjSub.DtResultados.Rows.Count + GvNoTimbradasCentroCosto.DataSource = ObjSub.DtResultados + + RegistraScript("$('#ModalNoTimbradasCentroCosto').modal('show');", "showmodal2Incons") + End If + End If + ObjSub.Dispose() + GvNoTimbradasCentroCosto.DataBind() + End Sub + + Private Sub CargaSubProyectos() + DdlSubproyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + DdlSubproyectos.DataBind() + DdlSubproyectos.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSubproyectos.SelectedIndex = 0 + End Sub + + Private Sub CargaGraficas() + + ' sino tiene permisos, no genera trabajo + If Not (UsuarioActual.TienePermisoIndicador(1) OrElse UsuarioActual.TienePermisoIndicador(2) OrElse + UsuarioActual.TienePermisoIndicador(3) OrElse UsuarioActual.TienePermisoIndicador(4) OrElse + UsuarioActual.TienePermisoIndicador(5) OrElse UsuarioActual.TienePermisoIndicador(6) OrElse + UsuarioActual.TienePermisoIndicador(7) OrElse UsuarioActual.TienePermisoIndicador(8)) Then + Exit Sub + End If + + DivIndicadores.InnerHtml = "" + Dim dtIndicadores As DataTable = Nothing + Dim dtVentas As DataTable = Nothing + Dim dtBancos As DataTable = Nothing + Dim dtRH As DataTable = Nothing + Dim dtBancosCuentas As DataTable = Nothing + + Dim Gral As New ClsGenerales + Dim ds As DataSet = Gral.GetIndicadores(UsuarioActual.CveEmpresa) + + If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then + + dtIndicadores = ds.Tables(0) + dtBancos = ds.Tables(1) + dtBancosCuentas = ds.Tables(2) + dtVentas = ds.Tables(3) + dtRH = ds.Tables(4) + + Graficas.Visible = True + DivIndicadores.Visible = True + + End If + Gral.Dispose() + + If dtIndicadores IsNot Nothing AndAlso dtIndicadores.Rows.Count > 0 Then + + Dim dr As DataRow = dtIndicadores.Rows(0) + + Select Case DdlFiltroIndicador.SelectedValue + Case "Ger" + + + If UsuarioActual.TienePermisoIndicador(1) Then + MuestraIndicador(DivIndicadores, "blue", "fa fa-automobile", "Ventas", dr("TotalVentas").ToString.FormatoNumero(0), "/Ventas/RepVentas.aspx", "Mes actual", dr("TotalVentasAcumulado").ToString.FormatoNumero(0), "link", "Anual") + End If + + If UsuarioActual.TienePermisoIndicador(2) Then + MuestraIndicador(DivIndicadores, "red-intense", "fa fa-bar-chart-o", "Compras", dr("TotalCompras").ToString.FormatoNumero(0), "/Compras/RepCompras.aspx", "Total Compras", dr("CxPVencido").ToString.FormatoNumero(0), "link", "Saldo Vencido", dr("CxPPorVencer").ToString.FormatoNumero(0), "link", "Saldo por vencer") + End If + + If UsuarioActual.TienePermisoIndicador(3) Then + MuestraIndicador(DivIndicadores, "green-haze", "fa fa-shopping-cart", "Bancos", String.Format("${0}", dr("TotalBancos").ToString.FormatoNumero), "/Bancos/RepSaldos.aspx", "") + End If + + If UsuarioActual.TienePermisoIndicador(4) Then + MuestraIndicador(DivIndicadores, "purple-plum", "fa fa-globe", "Crédito", String.Format("${0}", dr("TotalCredito").ToString.FormatoNumero), "", "") + End If + + If UsuarioActual.TienePermisoIndicador(5) Then + MuestraIndicador(DivIndicadores, "yellow", "fa fa-globe", "Inventario", String.Format("${0}", dr("TotalAlmacen").ToString.FormatoNumero), "/Inventarios/RepAlmacen.aspx", "") + End If + + If UsuarioActual.TienePermisoIndicador(6) Then + MuestraIndicador(DivIndicadores, "grey-cascade", "fa fa-globe", "Impuestos", String.Format("${0}", dr("TotalImpuestos").ToString.FormatoNumero), "", "") + + End If + If UsuarioActual.TienePermisoIndicador(13) Then + MuestraIndicador(DivIndicadores, "blue", "fa fa-globe", "Orden Producción", String.Format("{0}%", dr("TotalPorcentaje").ToString.FormatoNumero), "/CGame/RepAvance.aspx?Opcion=1", "") + + End If + End Select + + If UsuarioActual.CveRol = 1 Then + + Select Case DdlFiltroIndicador.SelectedValue + Case "RH" + MuestraIndicador(DivIndicadores, "green-haze", "fa fa-bar-chart-o", "Plantilla", dr("RH_Personal_Total").ToString, "", "Total Personal", dr("RH_Personal_Adm").ToString.FormatoNumero(0), "link", "Per. Adm.", dr("RH_Personal_Guardia").ToString.FormatoNumero(0), "link", "Per. Guardia.") + MuestraIndicador(DivIndicadores, "grey-cascade", "fa fa-globe", "Faltas", dr("RH_FaltasAnual").ToString.FormatoNumero(0), "", "Anual", dr("RH_FaltasMensual").ToString.FormatoNumero(0), "link", "Faltas Mensual", dr("RH_FaltasDia").ToString.FormatoNumero(0), "link", "Faltas de hoy") + MuestraIndicador(DivIndicadores, "red-intense", "fa fa-globe", "Ausentismo", "8.23%", "", "") + MuestraIndicador(DivIndicadores, "purple-plum", "fa fa-globe", "Rotación", "18.23%", "", "") + MuestraIndicador(DivIndicadores, "yellow", "fa fa-globe", "Uniformes", "Diciembre: 29", "", "") + 'MuestraGrafica(div_RHInd1, dtRH, "Sucursal", "Personal", "", "", "gh21", "") + GeneraGraficaRH(dtRH, "Personal Requerido", "por centro de costo") + GeneraGraficaRH2(dtRH, "Personal Actual", "por centro de costo") + divGraficas1.Visible = True + Case "Ger" + MuestraIndicador(DivIndicadores, "green-haze", "fa fa-bar-chart-o", "Plantilla", dr("RH_Personal_Total").ToString, "", "Total Personal", dr("RH_Personal_Adm").ToString.FormatoNumero(0), "link", "Per. Adm.", dr("RH_Personal_Guardia").ToString.FormatoNumero(0), "link", "Per. Guardia.") + + End Select + + End If + + 'End If + + End If + + If UsuarioActual.TienePermisoIndicador(7) Then + DvGraVentas.Visible = True + MuestraGrafica(div_ventas, dtVentas, "NombreMes", "Importe", "", "", "gh2", "$M") + Else + DvGraVentas.Visible = False + End If + + If UsuarioActual.TienePermisoIndicador(8) Then + DvGraBancos.Visible = True + + If dtBancos IsNot Nothing Then + MuestraGrafica(div_bancos, dtBancos, dtBancosCuentas, "NombreMes", "Importe", "", "", "gh1", "$", dtBancos.AVG("Importe").ToString.FormatoNumero) + End If + Else + DvGraBancos.Visible = False + End If + + Select Case DdlFiltroIndicador.SelectedValue + Case "Ger" + DvGraBancos.Visible = True + DvGraVentas.Visible = True + DivRHInd.Visible = False + Case "RH" + DivRHInd.Visible = True + DvGraBancos.Visible = False + DvGraVentas.Visible = False + End Select + + dtIndicadores = Nothing + dtBancos = Nothing + dtBancosCuentas = Nothing + dtVentas = Nothing + dtRH = Nothing + + End Sub + + Private Sub GeneraGraficaRH(data As DataTable, Titulo As String, SubTitulo As String) + 'remueve la columna CveSucursal + data.Columns.RemoveAt(0) + + Dim json As String = ToJsonString(GraficaStandarB(data, "column", Titulo, $"
{SubTitulo}
", False)) + Dim json2 As String = ToJsonString(GraficaStandar(data, "column", Titulo, $"
{SubTitulo}
", True)) + 'Literal1.Text = json + RegistraScript(String.Format("function CargaGrafica() {{$('#{2}').highcharts({0});}}function CargaGrafica2() {{$('#{2}').highcharts({1});}} CargaGrafica();", json, json2, div_RHInd1.ClientID), "grh1") + + End Sub + + Private Sub GeneraGraficaRH2(data As DataTable, Titulo As String, SubTitulo As String) + 'remueve la columna CveSucursal + 'data.Columns.RemoveAt(0) + data.Columns.RemoveAt(2) + + Dim json As String = ToJsonString(GraficaStandarB(data, "column", Titulo, $"
{SubTitulo}
", False)) + 'Dim json2 As String = ToJsonString(GraficaStandar(data, "column", Titulo, $"
{SubTitulo}
", True)) + 'Literal1.Text = json + RegistraScript(String.Format("function CargaGrafica3() {{$('#{2}').highcharts({0});}}function CargaGrafica4() {{$('#{2}').highcharts({1});}} CargaGrafica3();", json, "", divRHGrafica2.ClientID), "grh2") + + End Sub + + Private Sub CargaTareas() + Dim ObjProspectos As New ClsOIEventos + + Dim FechaI, FechaF As DateTime + Dim CveEventoEstatus As Integer = -1 + FechaI = Now.AddDays(-180) + FechaF = Now + If ObjProspectos.GetRepEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, 1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF) Then + + Dim DT As DataTable = ObjProspectos.DtResultados.Clone + + If ChkOIPorHacer.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioPara = {0} ", UsuarioActual.CveUsuario))) + If ChkOIAsigne.Checked Then DT.Merge(ObjProspectos.DtResultados.FiltraParametros(String.Format("CveUsuarioDe = {0} ", UsuarioActual.CveUsuario))) + + GvT.DataSource = DT + End If + + ObjProspectos.Dispose() + GvT.DataBind() + End Sub + Protected Sub GvT_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvT.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + Select Case UsuarioActual.CveUsuario.ToString + Case e.Row.DBCampo("CveUsuarioPara") + 'etiqueta de 'asignado' + e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-warning " + e.Row.FCLabel("LblTipo").Text = "por hacer " + Case e.Row.DBCampo("CveUsuarioDe") + e.Row.FCLabel("LblTipo").CssClass = "label label-sm label-success" + e.Row.FCLabel("LblTipo").Text = "Asigné" + End Select + End If + End Sub + Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String, Link As String, TitleComentario As String) + Dim htmldiv As New StringBuilder + htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) + htmldiv.AppendFormat("
{0}
Ver Más
", Link) + DIV.InnerHtml = htmldiv.ToString + End Sub + Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String) + Dim htmldiv As New StringBuilder + htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) + htmldiv.AppendFormat("
{0}
", Titulo) + htmldiv.AppendFormat("", CT1, C1) + htmldiv.AppendFormat("", CT2, C2) + htmldiv.Append("
Ver Más ") + htmldiv.AppendFormat("
") + DIV.InnerHtml = htmldiv.ToString + End Sub + Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String) + Dim htmldiv As New StringBuilder + htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) + htmldiv.AppendFormat("
{0}
", Titulo) + htmldiv.AppendFormat("", CT1, C1) + htmldiv.AppendFormat("", CT2, C2) + htmldiv.AppendFormat("", CT3, C3) + htmldiv.Append("
Ver Más ") + htmldiv.AppendFormat("
") + DIV.InnerHtml = htmldiv.ToString + End Sub + Private Sub MuestraIndicador(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, C1 As String, CL1 As String, CT1 As String, C2 As String, CL2 As String, CT2 As String, C3 As String, CL3 As String, CT3 As String, C4 As String, CL4 As String, CT4 As String) + Dim htmldiv As New StringBuilder + htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) + htmldiv.AppendFormat("
{0}
", Titulo, CT1, C1) + htmldiv.AppendFormat("", CT2, C2) + htmldiv.AppendFormat("", CT3, C3) + htmldiv.AppendFormat("", CT4, C4) + htmldiv.AppendFormat("
Ver Más
", CL1) + DIV.InnerHtml = htmldiv.ToString + End Sub + Private Sub MuestraGrafica(divcontainer As HtmlGenericControl, DTDatos As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Optional Indicador As String = "gh", Optional XReferencia As String = "", Optional YReferencia As String = "") + Dim Info As String = "" + Dim SBJSScript As New StringBuilder + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + For Each DbRow As DataRow In DTDatos.Rows + Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) + Next + Info = Info.Remove(Info.Length - 1, 1) + SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) + Else + SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia) + End If + RegistraScript(SBJSScript.ToString, Indicador) + End Sub + Private Sub MuestraGrafica(divcontainer As HtmlGenericControl, DTDatos As DataTable, DTPie As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Indicador As String, XReferencia As String, Promedio As String, Optional YReferencia As String = "") + Dim SBPie1 As New StringBuilder + Dim SBPie2 As New StringBuilder + Dim Info As String = "" + Dim SBJSScript As New StringBuilder + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + For Each DbRow As DataRow In DTDatos.Rows + Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) + Next + Info = Info.Remove(Info.Length - 1, 1) + End If + For Each DbRow As DataRow In DTPie.Rows + If DbRow("Importe").ToString.ToDouble > 0 Then SBPie1.AppendFormat("{{ name:'{1}- {2}',y:{0} }},", DbRow("Importe"), DbRow("Banco"), DbRow("NumCuenta")) + Next + + 'pesos y dolares + Dim Dolares As Double = DTPie.SUM("Importe", "CveMoneda = 2") + + If Dolares > 0 Then + SBPie2.AppendFormat("{{ name:'Dólares',y:{0} }},", Dolares) + SBPie2.AppendFormat("{{ name:'Pesos',y:{0} }},", DTPie.SUM("Importe", "CveMoneda = 1")) + End If + + If SBPie1.Length > 2 Then SBPie1 = SBPie1.Remove(SBPie1.Length - 1, 1) + If SBPie2.Length > 2 Then SBPie2 = SBPie2.Remove(SBPie2.Length - 1, 1) + SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, SBPie1, SBPie2) + + RegistraScript(SBJSScript.ToString, Indicador) + End Sub + Private Sub MuestraGrafica(DTDatos As DataTable, ColTitle As String, ColValue As String, TipoDato As String, DivId As String) + Dim Info As String = "" + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + For Each DbRow As DataRow In DTDatos.Rows + Info = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info) + Next + + Info = Info.Remove(Info.Length - 1, 1) + Dim SBJSScript As New StringBuilder + SBJSScript.AppendFormat("var datos=[{0}];graficaindex(datos,'{1}','{2}');", Info, DivId, TipoDato) + RegistraScript(SBJSScript.ToString, "g1") + End If + + End Sub + Private Sub MuestraGrafica(DTDatos As DataTable, DTDatos2 As DataTable, ColTitle As String, ColValue As String, TipoDato As String, DivId As String) + Dim Info As String = "" + Dim Info2 As String = "" + For Each DbRow As DataRow In DTDatos.Rows + Info = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info) + Next + For Each DbRow As DataRow In DTDatos2.Rows + Info2 = String.Format("{2}['{0}',{1}],", DbRow(ColTitle), DbRow(ColValue), Info2) + Next + Info2 = Info2.Remove(Info2.Length - 1, 1) + Info = Info.Remove(Info.Length - 1, 1) + Dim SBJSScript As New StringBuilder + SBJSScript.AppendFormat("var datos=[{0}];var datos2=[{3}];graficaindex2(datos,'{1}','{2}',datos2);", Info, DivId, TipoDato, Info2) + RegistraScript(SBJSScript.ToString, "g2") + End Sub + Private Sub MuestraGraficaRM(divcontainer As HtmlGenericControl, DTDatos As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Optional Indicador As String = "gh", Optional XReferencia As String = "", Optional YReferencia As String = "") + Dim Info As String = "" + Dim SBJSScript As New StringBuilder + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + For Each DbRow As DataRow In DTDatos.Rows + Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info) + Next + Info = Info.Remove(Info.Length - 1, 1) + SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia) + Else + SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia) + End If + RegistraScript(SBJSScript.ToString, Indicador) + End Sub + Private Function CargaSesionesActivas() As String + Dim SBSesiones As New StringBuilder + Try + + Dim DicSesiones As Dictionary(Of String, HttpSessionState) = DirectCast(Application("s"), Dictionary(Of String, HttpSessionState)) + + If DicSesiones IsNot Nothing Then + For Each DicItem As KeyValuePair(Of String, HttpSessionState) In DicSesiones + 'gv.Add(New String() With { _ + ' Key .SessionId = item.Key, _ + ' Key .SessionKey = Nothing, _ + ' Key .SessionValue = Nothing _ + '}) + SBSesiones.Append(DicItem.Key) + If DicItem.Value IsNot Nothing AndAlso DicItem.Value.Count > 0 Then + For Each DicKey As String In DicItem.Value.Keys + SBSesiones.Append(DicItem.Key) + SBSesiones.Append(DicKey) + SBSesiones.Append(If(DicItem.Value(DicKey) IsNot Nothing, DicItem.Value(DicKey).ToString(), String.Empty)) + 'gv.Add(New String() With { _ + ' Key .SessionId = item.Key, _ + ' Key .SessionKey = key, _ + ' Key .SessionValue = If(item.Value(key) IsNot Nothing, item.Value(key).ToString(), String.Empty) _ + '}) + Next + End If + SBSesiones.Append("
") + Next + + 'sessionValuesGrid.DataSource = gv + 'sessionValuesGrid.DataBind() + End If + Catch + End Try + Return SBSesiones.ToString End Function -#Region " FULL CALENDAR " - Private Sub InicializaCalendar() - RegistraScript("InitCalendar();") - - HdnU.Value = UsuarioActual.CveUsuario.ToString - HdnE.Value = UsuarioActual.CveEmpresa.ToString - - DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True - CargaTiposAgenda() - CheckRecurrencia.Attributes.Add("onclick", "CheckAdd(this);") - End Sub - Private Sub CargaTiposAgenda() - Dim ObjEventos As New ClsOIEventos - - If ObjEventos.GetAgendaTipo() Then - DdlAgedaTipo.DataSource = ObjEventos.DtResultados - DdlAgedaTipo.DataBind() - DdlAgedaTipo.Items.Insert(0, New ListItem("Seleccione", "-1")) - Else - Alert("Ocurrió un error al obtener los tipos de agenda. Por favor recargue la página", TipoMensaje.MsgError) - End If - - ObjEventos.Dispose() - End Sub - Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - Dim ObjEventos As New ClsOIEventos - - Dim FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime() - Dim FechaFin = TxtFechaFinAgenda.Text.ToDateTime() - - RegistraScript("GetView();") - - Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1" - If CheckRecurrencia.Checked Then - RecurrenciaTipo = RBLRecurrencia.SelectedValue.ToEntero - Frecuencia = TxtFrecuencia.Text.ToEntero - - 'OBTENEMOS LOS DIAS SELECCIONADOS EN LA OPCION DE RECURRENCIA POR SEMANA - Select Case RecurrenciaTipo - Case 3 - Dim StringDias = "" - For Each item As ListItem In CheckDiasSemana.Items - If item.Selected Then - If StringDias.Length > 0 Then - StringDias += "," - End If - StringDias += item.Value - End If - Next - If StringDias.Length > 0 Then - DiasSemana = StringDias - End If - End Select - - - 'If RBSinFechaFinAdd.Checked Then - ' RecurrenciaFin = "-1" - 'Else - If RBNumeroOcurrencias.Checked Then - RecurrenciaFin = TxtNumeroOcurrencias.Text - ElseIf RBFechaFin.Checked Then - RecurrenciaFin = TxtFechaFinRecurrencia.Text - Else - RecurrenciaFin = "-1" - End If - Else - If HdnCveEvento.Value.ToEntero > 0 Then - Frecuencia = -2 : DiasSemana = "-2" : Dias = -2 : Mes = -2 : RecurrenciaFin = "-2" - End If - End If - - '11/05/2018 - GASTO RECURRENTE - Dim CveTipoEvento As Integer = IIf(ChkGastoRecurrente.Checked, 10, 2).ToString().ToEntero() - Dim Importe As Double = Convert.ToDouble(IIf(ChkGastoRecurrente.Checked, TxtImporteGastoRecurrente.Text, "-1")) - - If HdnCveEvento.Value.ToEntero > 0 Then - If ObjEventos.UpdateEvento(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, DdlAgedaTipo.SelectedValue.ToEntero, -1, FechaInicio, FechaFin, -1, "-1", HdnCveEvento.Value.ToEntero, "-1", - RecurrenciaTipo, Frecuencia, DiasSemana, Dias, Mes, RecurrenciaFin, Importe:=Importe) Then - Alert("El Evento se actualizó correctamente", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrió un error al actualizar el evento", TipoMensaje.MsgAdvertencia) - End If - Else - If ObjEventos.AddEventoAgenda(DdlAgedaTipo.SelectedValue.ToEntero, TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe) Then - - Alert("El Evento se guardó correctamente", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrió un error al Guardar el evento", TipoMensaje.MsgAdvertencia) - End If - End If - - ObjEventos.Dispose() - RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") - LimpiaModalAgenda() - - End Sub - Private Sub LimpiaModalAgenda() - TxtDescripcionAgenda.Text = "" - TxtAsuntoAgenda.Text = "" - DdlPrioridad.SelectedValue = "1" - TxtNumeroOcurrencias.Text = "" - TxtFechaFinRecurrencia.Text = "" - RBFechaFin.Checked = False - RBNumeroOcurrencias.Checked = False - RBLRecurrencia.SelectedValue = "1" - CheckDiasSemana.ClearSelection() - RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) - TxtFrecuencia.Text = "1" - End Sub - - Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) - - Dim ObjEventos As New ClsOIEventos - RegistraScript("GetView();") - - If ObjEventos.RemoveEvento(HdnCveEvento.Value.ToEntero, UsuarioActual.CveEmpresa) Then - RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") - Alert("El evento se eliminó correctamente", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrió un error al eliminar el evento, por favor intente de nuevo.", TipoMensaje.MsgError) - End If - - ObjEventos.Dispose() - End Sub - - - Public Shared Function EliminaEvento(CveEvento As Integer, CveEmpresa As Integer) As String - Dim ObjEventos As New ClsOIEventos - - ObjEventos.RemoveEvento(CveEvento, CveEmpresa) - - ObjEventos.Dispose() - Return CveEvento.ToString - End Function - - - Public Shared Function ActualizaEvento(ClsEvent As CalendarEvent) As String - Dim ObjEventos As New ClsOIEventos - - Dim FechaInicio = DateTimeOffset.Parse(ClsEvent.start).DateTime - Dim FechaFin = DateTimeOffset.Parse(ClsEvent.end).DateTime - - If ObjEventos.UpdateEvento("-1", "-1", -1, -1, -1, FechaInicio, FechaFin, -1, "-1", ClsEvent.id) Then - End If - - ObjEventos.Dispose() - Return "a" - End Function - Protected Sub RBLRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs) - Select Case RBLRecurrencia.SelectedValue.ToEntero - Case 1 - LblTextoFrecuencia.Text = "Hora(s)" - TrDiasSemanaAdd.Style("display") = "none" - Case 2 - LblTextoFrecuencia.Text = "Dia(s)" - TrDiasSemanaAdd.Style("display") = "none" - Case 3 - LblTextoFrecuencia.Text = "Semana(s)" - TrDiasSemanaAdd.Style("display") = "block" - - 'Chequea los dias seleccionados en la recurrencia - For Each item As ListItem In CheckDiasSemana.Items - If HdnDiasSemanaAgendar.Value.Contains(item.Value) Then - item.Selected = True - Else - item.Selected = False - End If - Next - Case 4 - LblTextoFrecuencia.Text = "Mes(es)" - TrDiasSemanaAdd.Style("display") = "none" - Case 5 - LblTextoFrecuencia.Text = "Año(s)" - TrDiasSemanaAdd.Style("display") = "none" - Case Else - End Select - UpRecurrencia.Update() - End Sub - Protected Sub BtnActualizaAdd_Click(sender As Object, e As EventArgs) - RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) - End Sub -#End Region +#Region " FULL CALENDAR " + Private Sub InicializaCalendar() + RegistraScript("InitCalendar();") - Protected Sub ChkOIAsigne_CheckedChanged(sender As Object, e As EventArgs) Handles ChkOIAsigne.CheckedChanged, ChkOIPorHacer.CheckedChanged - CargaTareas() - End Sub - Protected Sub DdlFiltroIndicador_SelectedIndexChanged(sender As Object, e As EventArgs) - - End Sub - Protected Sub BtnIndicador_Click(sender As Object, e As EventArgs) + HdnU.Value = UsuarioActual.CveUsuario.ToString + HdnE.Value = UsuarioActual.CveEmpresa.ToString + + DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True + CargaTiposAgenda() + CheckRecurrencia.Attributes.Add("onclick", "CheckAdd(this);") + End Sub + Private Sub CargaTiposAgenda() + Dim ObjEventos As New ClsOIEventos + + If ObjEventos.GetAgendaTipo() Then + DdlAgedaTipo.DataSource = ObjEventos.DtResultados + DdlAgedaTipo.DataBind() + DdlAgedaTipo.Items.Insert(0, New ListItem("Seleccione", "-1")) + Else + Alert("Ocurrió un error al obtener los tipos de agenda. Por favor recargue la página", TipoMensaje.MsgError) + End If + + ObjEventos.Dispose() + End Sub + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + Dim ObjEventos As New ClsOIEventos + + Dim FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime() + Dim FechaFin = TxtFechaFinAgenda.Text.ToDateTime() + + RegistraScript("GetView();") + + Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1" + If CheckRecurrencia.Checked Then + RecurrenciaTipo = RBLRecurrencia.SelectedValue.ToEntero + Frecuencia = TxtFrecuencia.Text.ToEntero + + 'OBTENEMOS LOS DIAS SELECCIONADOS EN LA OPCION DE RECURRENCIA POR SEMANA + Select Case RecurrenciaTipo + Case 3 + Dim StringDias = "" + For Each item As ListItem In CheckDiasSemana.Items + If item.Selected Then + If StringDias.Length > 0 Then + StringDias += "," + End If + StringDias += item.Value + End If + Next + If StringDias.Length > 0 Then + DiasSemana = StringDias + End If + End Select + + + 'If RBSinFechaFinAdd.Checked Then + ' RecurrenciaFin = "-1" + 'Else + If RBNumeroOcurrencias.Checked Then + RecurrenciaFin = TxtNumeroOcurrencias.Text + ElseIf RBFechaFin.Checked Then + RecurrenciaFin = TxtFechaFinRecurrencia.Text + Else + RecurrenciaFin = "-1" + End If + Else + If HdnCveEvento.Value.ToEntero > 0 Then + Frecuencia = -2 : DiasSemana = "-2" : Dias = -2 : Mes = -2 : RecurrenciaFin = "-2" + End If + End If + + '11/05/2018 - GASTO RECURRENTE + Dim CveTipoEvento As Integer = IIf(ChkGastoRecurrente.Checked, 10, 2).ToString().ToEntero() + Dim Importe As Double = Convert.ToDouble(IIf(ChkGastoRecurrente.Checked, TxtImporteGastoRecurrente.Text, "-1")) + + If HdnCveEvento.Value.ToEntero > 0 Then + If ObjEventos.UpdateEvento(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, DdlAgedaTipo.SelectedValue.ToEntero, -1, FechaInicio, FechaFin, -1, "-1", HdnCveEvento.Value.ToEntero, "-1", + RecurrenciaTipo, Frecuencia, DiasSemana, Dias, Mes, RecurrenciaFin, Importe:=Importe) Then + Alert("El Evento se actualizó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al actualizar el evento", TipoMensaje.MsgAdvertencia) + End If + Else + If ObjEventos.AddEventoAgenda(DdlAgedaTipo.SelectedValue.ToEntero, TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe) Then + + Alert("El Evento se guardó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al Guardar el evento", TipoMensaje.MsgAdvertencia) + End If + End If + + ObjEventos.Dispose() + RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") + LimpiaModalAgenda() + + End Sub + Private Sub LimpiaModalAgenda() + TxtDescripcionAgenda.Text = "" + TxtAsuntoAgenda.Text = "" + DdlPrioridad.SelectedValue = "1" + TxtNumeroOcurrencias.Text = "" + TxtFechaFinRecurrencia.Text = "" + RBFechaFin.Checked = False + RBNumeroOcurrencias.Checked = False + RBLRecurrencia.SelectedValue = "1" + CheckDiasSemana.ClearSelection() + RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) + TxtFrecuencia.Text = "1" End Sub -#Region "DIRECTORIO TELEFONICO" - Private Sub CargaDirectorioTelefonico() - Dim ObjPersonal As New ClsRH - - Me.RegistraScript("$get('DivActualizarEvento').style.display = 'true';") - '$get('DivActualizarEvento').style.display = 'none'; - - If ObjPersonal.DirectorioTelefonicoGet(UsuarioActual.CveEmpresa) Then - GvDirectorio.DataSource = ObjPersonal.DtResultados - End If - - GvDirectorio.Columns(2).Visible = False - - ' 8/10/2018 - Se omite validacion de visibilidad de Columna Telefono Personal solo para usuario Dennise Cruz - 'If UsuarioActual.CveUsuario = 1781 Then - ' GvDirectorio.Columns(5).Visible = True - 'Else - ' GvDirectorio.Columns(5).Visible = False - 'End If - - ObjPersonal.Dispose() - GvDirectorio.DataBind() - UPDatosDirectorio.Update() - End Sub - - Protected Sub GvDirectorio_RowDataBound(sender As Object, e As GridViewRowEventArgs) - - If e.Row.RowType = DataControlRowType.DataRow Then - If String.IsNullOrEmpty(e.Row.DBCampo("CvePersonal")) Then - e.Row.Style("background-color") = "#F1B168" - 'e.Row.FCHyperLink("HypDeptoPersonal").Style("text-decoration") = "none" - 'e.Row.FCHyperLink("HypDeptoPersonal").ForeColor = Drawing.Color.Black - Else - 'e.Row.FCHyperLink("HypDeptoPersonal").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal")) - End If - End If - - - End Sub -#End Region + Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) -#Region "Metodos Graficar" - Public Function GraficaLineas(data As DataTable, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional SinCols As String = "0", Optional VerValor As Boolean = False, Optional G1 As Boolean = False) As HighChart - Dim grafica As New HighChart - If Not IsNothing(data) Then - - grafica.chart = New Chart - grafica.chart.type = "line" - grafica.title = New Title - grafica.title.text = Titulo - grafica.subtitle = New Title - grafica.subtitle.text = Subtitulo - grafica.subtitle.useHTML = True - grafica.yAxis = New Axis - grafica.yAxis.title = New Title - grafica.yAxis.title.text = " " - grafica.xAxis = New Axis - If VerValor Then - grafica.plotOptions = New PlotOptions - grafica.plotOptions.line = New Line - grafica.plotOptions.line.dataLabels = New DataLabels - grafica.plotOptions.line.dataLabels.enabled = True - End If - grafica.xAxis.categories = New List(Of String) - - Dim index As Integer = 0 - Dim contador As Integer = 0 - For Each col As DataColumn In data.Columns - - If contador = 0 Then - index = contador - Else - grafica.xAxis.categories.Add(col.ColumnName) - End If - contador += 1 - - Next - grafica.series = New List(Of Series) - - For Each row As DataRow In data.Rows - Dim serie As New Series - serie.data = New List(Of Object) - Dim anterior As Double = 0 - For i As Integer = 0 To data.Columns.Count - 1 - If i = index Then - serie.name = row(i).ToString() - Else - Dim actual = row(i).ToString().ToDouble - serie.data.Add(actual) - anterior = actual - End If - Next - grafica.series.Add(serie) - Next - - End If - Return grafica - End Function - Public Function GraficaStandar(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart - Dim grafica As New HighChart - If Not IsNothing(data) Then - - grafica.chart = New Chart - grafica.chart.type = charttype - grafica.title = New Title - grafica.title.text = Titulo - grafica.subtitle = New Title - grafica.subtitle.text = Subtitulo - grafica.subtitle.useHTML = True - grafica.yAxis = New Axis - grafica.yAxis.title = New Title - grafica.yAxis.title.text = " " - grafica.xAxis = New Axis - grafica.xAxis.categories = New List(Of String) - - Dim index As Integer = 0 - Dim contador As Integer = 0 - - If charttype = "bar" Then - For Each col As DataRow In data.Rows - grafica.xAxis.categories.Add(col(0).ToString) - contador += 1 - - Next - grafica.series = New List(Of Series) - - For i As Integer = 1 To data.Columns.Count - 1 - Dim serie As New Series - serie.data = New List(Of Object) - serie.name = data.Columns(i).ColumnName - For Each row As DataRow In data.Rows - serie.data.Add(row(i).ToString().ToDouble) - Next - If VerValor Then - - serie.dataLabels = New DataLabels - serie.dataLabels.enabled = True - End If - grafica.series.Add(serie) - Next - - Else - For Each col As DataColumn In data.Columns - - If contador = 0 Then - index = contador - Else - grafica.xAxis.categories.Add(col.ColumnName) - End If - contador += 1 - - Next - grafica.series = New List(Of Series) - - For Each row As DataRow In data.Rows - Dim serie As New Series - serie.data = New List(Of Object) - For i As Integer = 0 To data.Columns.Count - 1 - If i = index Then - serie.name = row(i).ToString() - Else - serie.data.Add(row(i).ToString().ToDouble) - End If - Next - If VerValor Then - - serie.dataLabels = New DataLabels - serie.dataLabels.enabled = True - End If - grafica.series.Add(serie) - Next - End If - End If - Return grafica - End Function - Public Function GraficaStandarB(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart - Dim grafica As New HighChart - If Not IsNothing(data) Then - - grafica.chart = New Chart - grafica.chart.type = charttype - grafica.title = New Title - grafica.title.text = Titulo - grafica.subtitle = New Title - grafica.subtitle.text = Subtitulo - grafica.subtitle.useHTML = True - grafica.yAxis = New Axis - grafica.yAxis.title = New Title - grafica.yAxis.title.text = " " - grafica.xAxis = New Axis - grafica.xAxis.categories = New List(Of String) - - Dim index As Integer = 0 - Dim contador As Integer = 0 - - If charttype = "bar" Then - For Each col As DataRow In data.Rows - - grafica.xAxis.categories.Add(col(0).ToString) - contador += 1 - - Next - grafica.series = New List(Of Series) - - For i As Integer = 1 To data.Columns.Count - 1 - Dim serie As New Series - serie.data = New List(Of Object) - serie.name = data.Columns(i).ColumnName - For Each row As DataRow In data.Rows - serie.data.Add(row(i).ToString().ToDouble) - Next - If VerValor Then - - serie.dataLabels = New DataLabels - serie.dataLabels.enabled = True - End If - grafica.series.Add(serie) - Next - - Else - For Each col As DataRow In data.Rows - - grafica.xAxis.categories.Add(col(0).ToString) - contador += 1 - - Next - grafica.series = New List(Of Series) - For x As Integer = 1 To data.Columns.Count - 1 - Dim serie As New Series - serie.data = New List(Of Object) - serie.name = data.Columns(x).ColumnName - For i As Integer = 0 To data.Rows.Count - 1 - serie.data.Add(data.Rows(i)(x).ToString().ToDouble) - Next - grafica.series.Add(serie) - Next - - End If - End If - Return grafica - End Function - - Public Function GraficaStacked(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart - - Dim grafica As HighChart - grafica = GraficaStandar(data, charttype, Titulo, Subtitulo, VerValor) - If IsNothing(grafica.plotOptions) Then - grafica.plotOptions = New PlotOptions() - End If - If IsNothing(grafica.plotOptions.column) Then - grafica.plotOptions.column = New Column - End If - grafica.plotOptions.column.stacking = "normal" - - If VerValor Then - grafica.yAxis.stackLabels = New DataLabels - grafica.yAxis.stackLabels.enabled = True - 'grafica.yAxis.stackLabels.color = "#FFFFFF" - grafica.yAxis.stackLabels.rotation = -90 - grafica.yAxis.stackLabels.y = -35 - End If - Return grafica - - End Function - Public Function ToJsonString(obj As Object) As String - Dim settings As New JsonSerializerSettings - settings.NullValueHandling = NullValueHandling.Ignore - settings.Formatting = Formatting.Indented - Return JsonConvert.SerializeObject(obj, settings).ToString + Dim ObjEventos As New ClsOIEventos + RegistraScript("GetView();") + + If ObjEventos.RemoveEvento(HdnCveEvento.Value.ToEntero, UsuarioActual.CveEmpresa) Then + RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") + Alert("El evento se eliminó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al eliminar el evento, por favor intente de nuevo.", TipoMensaje.MsgError) + End If + + ObjEventos.Dispose() + End Sub + + + Public Shared Function EliminaEvento(CveEvento As Integer, CveEmpresa As Integer) As String + Dim ObjEventos As New ClsOIEventos + + ObjEventos.RemoveEvento(CveEvento, CveEmpresa) + + ObjEventos.Dispose() + Return CveEvento.ToString End Function -#End Region - Protected Sub LnkIndicador_Click(sender As Object, e As EventArgs) - CargaGraficas() + + Public Shared Function ActualizaEvento(ClsEvent As CalendarEvent) As String + Dim ObjEventos As New ClsOIEventos + + Dim FechaInicio = DateTimeOffset.Parse(ClsEvent.start).DateTime + Dim FechaFin = DateTimeOffset.Parse(ClsEvent.end).DateTime + + If ObjEventos.UpdateEvento("-1", "-1", -1, -1, -1, FechaInicio, FechaFin, -1, "-1", ClsEvent.id) Then + End If + + ObjEventos.Dispose() + Return "a" + End Function + Protected Sub RBLRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs) + Select Case RBLRecurrencia.SelectedValue.ToEntero + Case 1 + LblTextoFrecuencia.Text = "Hora(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case 2 + LblTextoFrecuencia.Text = "Dia(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case 3 + LblTextoFrecuencia.Text = "Semana(s)" + TrDiasSemanaAdd.Style("display") = "block" + + 'Chequea los dias seleccionados en la recurrencia + For Each item As ListItem In CheckDiasSemana.Items + If HdnDiasSemanaAgendar.Value.Contains(item.Value) Then + item.Selected = True + Else + item.Selected = False + End If + Next + Case 4 + LblTextoFrecuencia.Text = "Mes(es)" + TrDiasSemanaAdd.Style("display") = "none" + Case 5 + LblTextoFrecuencia.Text = "Año(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case Else + End Select + UpRecurrencia.Update() + End Sub + Protected Sub BtnActualizaAdd_Click(sender As Object, e As EventArgs) + RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) + End Sub +#End Region + + Protected Sub ChkOIAsigne_CheckedChanged(sender As Object, e As EventArgs) Handles ChkOIAsigne.CheckedChanged, ChkOIPorHacer.CheckedChanged + CargaTareas() + End Sub + Protected Sub DdlFiltroIndicador_SelectedIndexChanged(sender As Object, e As EventArgs) + + End Sub + Protected Sub BtnIndicador_Click(sender As Object, e As EventArgs) + End Sub + +#Region "DIRECTORIO TELEFONICO" + Private Sub CargaDirectorioTelefonico() + Dim ObjPersonal As New ClsRH + + Me.RegistraScript("$get('DivActualizarEvento').style.display = 'true';") + '$get('DivActualizarEvento').style.display = 'none'; + + If ObjPersonal.DirectorioTelefonicoGet(UsuarioActual.CveEmpresa) Then + GvDirectorio.DataSource = ObjPersonal.DtResultados + End If + + GvDirectorio.Columns(2).Visible = False + + ' 8/10/2018 - Se omite validacion de visibilidad de Columna Telefono Personal solo para usuario Dennise Cruz + 'If UsuarioActual.CveUsuario = 1781 Then + ' GvDirectorio.Columns(5).Visible = True + 'Else + ' GvDirectorio.Columns(5).Visible = False + 'End If + + ObjPersonal.Dispose() + GvDirectorio.DataBind() + UPDatosDirectorio.Update() + End Sub + + Protected Sub GvDirectorio_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + If String.IsNullOrEmpty(e.Row.DBCampo("CvePersonal")) Then + e.Row.Style("background-color") = "#F1B168" + 'e.Row.FCHyperLink("HypDeptoPersonal").Style("text-decoration") = "none" + 'e.Row.FCHyperLink("HypDeptoPersonal").ForeColor = Drawing.Color.Black + Else + 'e.Row.FCHyperLink("HypDeptoPersonal").NavigateUrl = String.Format("/RH/Personal.aspx?CvePersonal={0}", e.Row.DBCampo("CvePersonal")) + End If + End If + + + End Sub +#End Region + +#Region "Metodos Graficar" + Public Function GraficaLineas(data As DataTable, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional SinCols As String = "0", Optional VerValor As Boolean = False, Optional G1 As Boolean = False) As HighChart + Dim grafica As New HighChart + If Not IsNothing(data) Then + + grafica.chart = New Chart + grafica.chart.type = "line" + grafica.title = New Title + grafica.title.text = Titulo + grafica.subtitle = New Title + grafica.subtitle.text = Subtitulo + grafica.subtitle.useHTML = True + grafica.yAxis = New Axis + grafica.yAxis.title = New Title + grafica.yAxis.title.text = " " + grafica.xAxis = New Axis + If VerValor Then + grafica.plotOptions = New PlotOptions + grafica.plotOptions.line = New Line + grafica.plotOptions.line.dataLabels = New DataLabels + grafica.plotOptions.line.dataLabels.enabled = True + End If + grafica.xAxis.categories = New List(Of String) + + Dim index As Integer = 0 + Dim contador As Integer = 0 + For Each col As DataColumn In data.Columns + + If contador = 0 Then + index = contador + Else + grafica.xAxis.categories.Add(col.ColumnName) + End If + contador += 1 + + Next + grafica.series = New List(Of Series) + + For Each row As DataRow In data.Rows + Dim serie As New Series + serie.data = New List(Of Object) + Dim anterior As Double = 0 + For i As Integer = 0 To data.Columns.Count - 1 + If i = index Then + serie.name = row(i).ToString() + Else + Dim actual = row(i).ToString().ToDouble + serie.data.Add(actual) + anterior = actual + End If + Next + grafica.series.Add(serie) + Next + + End If + Return grafica + End Function + Public Function GraficaStandar(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart + Dim grafica As New HighChart + If Not IsNothing(data) Then + + grafica.chart = New Chart + grafica.chart.type = charttype + grafica.title = New Title + grafica.title.text = Titulo + grafica.subtitle = New Title + grafica.subtitle.text = Subtitulo + grafica.subtitle.useHTML = True + grafica.yAxis = New Axis + grafica.yAxis.title = New Title + grafica.yAxis.title.text = " " + grafica.xAxis = New Axis + grafica.xAxis.categories = New List(Of String) + + Dim index As Integer = 0 + Dim contador As Integer = 0 + + If charttype = "bar" Then + For Each col As DataRow In data.Rows + grafica.xAxis.categories.Add(col(0).ToString) + contador += 1 + + Next + grafica.series = New List(Of Series) + + For i As Integer = 1 To data.Columns.Count - 1 + Dim serie As New Series + serie.data = New List(Of Object) + serie.name = data.Columns(i).ColumnName + For Each row As DataRow In data.Rows + serie.data.Add(row(i).ToString().ToDouble) + Next + If VerValor Then + + serie.dataLabels = New DataLabels + serie.dataLabels.enabled = True + End If + grafica.series.Add(serie) + Next + + Else + For Each col As DataColumn In data.Columns + + If contador = 0 Then + index = contador + Else + grafica.xAxis.categories.Add(col.ColumnName) + End If + contador += 1 + + Next + grafica.series = New List(Of Series) + + For Each row As DataRow In data.Rows + Dim serie As New Series + serie.data = New List(Of Object) + For i As Integer = 0 To data.Columns.Count - 1 + If i = index Then + serie.name = row(i).ToString() + Else + serie.data.Add(row(i).ToString().ToDouble) + End If + Next + If VerValor Then + + serie.dataLabels = New DataLabels + serie.dataLabels.enabled = True + End If + grafica.series.Add(serie) + Next + End If + End If + Return grafica + End Function + Public Function GraficaStandarB(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart + Dim grafica As New HighChart + If Not IsNothing(data) Then + + grafica.chart = New Chart + grafica.chart.type = charttype + grafica.title = New Title + grafica.title.text = Titulo + grafica.subtitle = New Title + grafica.subtitle.text = Subtitulo + grafica.subtitle.useHTML = True + grafica.yAxis = New Axis + grafica.yAxis.title = New Title + grafica.yAxis.title.text = " " + grafica.xAxis = New Axis + grafica.xAxis.categories = New List(Of String) + + Dim index As Integer = 0 + Dim contador As Integer = 0 + + If charttype = "bar" Then + For Each col As DataRow In data.Rows + + grafica.xAxis.categories.Add(col(0).ToString) + contador += 1 + + Next + grafica.series = New List(Of Series) + + For i As Integer = 1 To data.Columns.Count - 1 + Dim serie As New Series + serie.data = New List(Of Object) + serie.name = data.Columns(i).ColumnName + For Each row As DataRow In data.Rows + serie.data.Add(row(i).ToString().ToDouble) + Next + If VerValor Then + + serie.dataLabels = New DataLabels + serie.dataLabels.enabled = True + End If + grafica.series.Add(serie) + Next + + Else + For Each col As DataRow In data.Rows + + grafica.xAxis.categories.Add(col(0).ToString) + contador += 1 + + Next + grafica.series = New List(Of Series) + For x As Integer = 1 To data.Columns.Count - 1 + Dim serie As New Series + serie.data = New List(Of Object) + serie.name = data.Columns(x).ColumnName + For i As Integer = 0 To data.Rows.Count - 1 + serie.data.Add(data.Rows(i)(x).ToString().ToDouble) + Next + grafica.series.Add(serie) + Next + + End If + End If + Return grafica + End Function + + Public Function GraficaStacked(data As DataTable, charttype As String, Optional Titulo As String = "", Optional Subtitulo As String = "", Optional VerValor As Boolean = False) As HighChart + + Dim grafica As HighChart + grafica = GraficaStandar(data, charttype, Titulo, Subtitulo, VerValor) + If IsNothing(grafica.plotOptions) Then + grafica.plotOptions = New PlotOptions() + End If + If IsNothing(grafica.plotOptions.column) Then + grafica.plotOptions.column = New Column + End If + grafica.plotOptions.column.stacking = "normal" + + If VerValor Then + grafica.yAxis.stackLabels = New DataLabels + grafica.yAxis.stackLabels.enabled = True + 'grafica.yAxis.stackLabels.color = "#FFFFFF" + grafica.yAxis.stackLabels.rotation = -90 + grafica.yAxis.stackLabels.y = -35 + End If + Return grafica + + End Function + Public Function ToJsonString(obj As Object) As String + Dim settings As New JsonSerializerSettings + settings.NullValueHandling = NullValueHandling.Ignore + settings.Formatting = Formatting.Indented + Return JsonConvert.SerializeObject(obj, settings).ToString + End Function + +#End Region + Protected Sub LnkIndicador_Click(sender As Object, e As EventArgs) + CargaGraficas() End Sub -#Region "COMUNICADO" - Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) - RegistraScript("$('#DvModalComunicado').modal('show');") - End Sub - Protected Sub CargaComunicado() - - Dim ObjEmpresa As ClsSisEmpresas = New ClsSisEmpresas - - DivComunicado.InnerHtml = "" - - If ObjEmpresa.GetComunicado(UsuarioActual.CveEmpresa) Then - If ObjEmpresa.DtResultados.Rows.Count > 0 And ObjEmpresa.DtResultados(0)("Comunicado").ToString() <> "" Then - DivComunicado.Visible = True - Dim Comunicado As String = ObjEmpresa.DtResultados(0)("Comunicado").ToString() - - Dim ListaComunicados As String() = Comunicado.Split("|") - Dim Turno As Integer = 1 - For Each s As String In ListaComunicados - If (Turno Mod 2) = 0 Then - MuestraComunicado(DivComunicado, "purple-plum", "fa fa-bullhorn", "", s.ToString()) - Else - MuestraComunicado(DivComunicado, "grey-cascade", "fa fa-bullhorn", "", s.ToString()) - End If - - Turno += 1 - Next - - TxtComunicado.Text = ObjEmpresa.DtResultados(0)("Comunicado").ToString() - - Else - DivComunicado.Visible = False - 'DivComunicadoTexto.InnerHtml = "" - TxtComunicado.Text = "" - End If - End If - - ObjEmpresa.Dispose() - End Sub - - Protected Sub BtnActualizarComunicado_Click(sender As Object, e As EventArgs) - Dim ObjEmpresa As ClsSisEmpresas = New ClsSisEmpresas - - If ObjEmpresa.UpdateComunicado(UsuarioActual.CveEmpresa, TxtComunicado.Text) Then - Alert("Comunicado Actualizado Correctamente", TipoMensaje.MsgInformacion) - RegistraScript("$('#DvModalComunicado').modal('hide');") - End If - ObjEmpresa.Dispose() - CargaComunicado() - UPComunicado.Update() - End Sub - - Private Sub MuestraComunicado(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String) - Dim htmldiv As New StringBuilder - 'htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) - 'htmldiv.AppendFormat("
", "") - - htmldiv.AppendFormat("{2}

{0} {1}

", Titulo, Comentario, DIV.InnerHtml, Icono) - - DIV.InnerHtml = htmldiv.ToString +#Region "COMUNICADO" + Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) + RegistraScript("$('#DvModalComunicado').modal('show');") End Sub -#End Region - Protected Sub BtnEvaluarProveedores_Click(sender As Object, e As EventArgs) - - End Sub -End Class + Protected Sub CargaComunicado() + + Dim ObjEmpresa As ClsSisEmpresas = New ClsSisEmpresas + + DivComunicado.InnerHtml = "" + + If ObjEmpresa.GetComunicado(UsuarioActual.CveEmpresa) Then + If ObjEmpresa.DtResultados.Rows.Count > 0 And ObjEmpresa.DtResultados(0)("Comunicado").ToString() <> "" Then + DivComunicado.Visible = True + Dim Comunicado As String = ObjEmpresa.DtResultados(0)("Comunicado").ToString() + + Dim ListaComunicados As String() = Comunicado.Split("|") + Dim Turno As Integer = 1 + For Each s As String In ListaComunicados + If (Turno Mod 2) = 0 Then + MuestraComunicado(DivComunicado, "purple-plum", "fa fa-bullhorn", "", s.ToString()) + Else + MuestraComunicado(DivComunicado, "grey-cascade", "fa fa-bullhorn", "", s.ToString()) + End If + + Turno += 1 + Next + + TxtComunicado.Text = ObjEmpresa.DtResultados(0)("Comunicado").ToString() + + Else + DivComunicado.Visible = False + 'DivComunicadoTexto.InnerHtml = "" + TxtComunicado.Text = "" + End If + End If + + ObjEmpresa.Dispose() + End Sub + + Protected Sub BtnActualizarComunicado_Click(sender As Object, e As EventArgs) + Dim ObjEmpresa As ClsSisEmpresas = New ClsSisEmpresas + + If ObjEmpresa.UpdateComunicado(UsuarioActual.CveEmpresa, TxtComunicado.Text) Then + Alert("Comunicado Actualizado Correctamente", TipoMensaje.MsgInformacion) + RegistraScript("$('#DvModalComunicado').modal('hide');") + End If + ObjEmpresa.Dispose() + CargaComunicado() + UPComunicado.Update() + End Sub + + Private Sub MuestraComunicado(DIV As HtmlGenericControl, Color As String, Icono As String, Titulo As String, Comentario As String) + Dim htmldiv As New StringBuilder + 'htmldiv.AppendFormat("{0}
", DIV.InnerHtml, Color, Icono) + 'htmldiv.AppendFormat("
", "") + + htmldiv.AppendFormat("{2}

{0} {1}

", Titulo, Comentario, DIV.InnerHtml, Icono) + + DIV.InnerHtml = htmldiv.ToString + End Sub +#End Region + Protected Sub BtnEvaluarProveedores_Click(sender As Object, e As EventArgs) + + End Sub +End Class From d7ccb2a4706c8c12591055d5929a7602d479819b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Wed, 1 Apr 2020 14:52:30 -0700 Subject: [PATCH 4/8] =?UTF-8?q?cat=C3=A1logo=20tentativamente=20terminado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContabilidad.vb | 25 +++++++++++++++++ Contabilidad2/CatContaEjercicios.aspx | 34 ++++++++++++++++++++---- Contabilidad2/CatContaEjercicios.aspx.vb | 33 +++++++++++++++++++---- 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index de8677cf2..a996d38e7 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -5961,6 +5961,31 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function CierreEjercicio(CveEmpresa As Integer, Ejercicio As Integer, CveCuentaCierre As Integer, FechaI As String, FechaF As String, CveUsuario As Integer) As Integer + Dim Retorno As Integer = -1 + + DataAdapter("PA_Conta_CierreEjercicio") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + .Add("@CveCuentaCierre", SqlDbType.Int).Value = CveCuentaCierre + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.DateTime).Value = FechaF + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CvePrePoliza", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero + Catch ex As Exception + Me.OnError("Ocurrió un error al eliminar el catálogo de Conta Ejercicios", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + #Region " RECONSTRUCCION DE PREPOLIZAS " Public Function ReconstruirPP_PagoCompra(CvePrePoliza As Integer) As Boolean Dim Retorno = False diff --git a/Contabilidad2/CatContaEjercicios.aspx b/Contabilidad2/CatContaEjercicios.aspx index edd8f515f..c61ecab0a 100644 --- a/Contabilidad2/CatContaEjercicios.aspx +++ b/Contabilidad2/CatContaEjercicios.aspx @@ -24,7 +24,7 @@ @@ -33,12 +33,17 @@ - + + + + + + - + @@ -60,14 +65,33 @@