From 580537a066f7bcb19cc336ccfe3aa26803e5afb5 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 13 Jan 2021 15:23:46 -0700 Subject: [PATCH] verifica si usa contabilidad --- Planeacion/CatSubProyectos.aspx.vb | 76 ++++++++++++++++-------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 9b1b67cba..0d8a3fcd5 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -136,47 +136,51 @@ Partial Class CatSubProyectos Private Sub CargaSegmentosNegocio() DdlSegmentoNegocio.Items.Clear() - Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa) - - If Cuenta.GetSegmentosNegocio(-1, "-1") Then - - DtSegmentosNegocio = Cuenta.DtResultados.FiltraParametros("Id > 0") - DtSegmentosNegocio.Rows.Add(New Object() {0, 0, " - ", "", ""}) - - Dim dataView As New DataView(DtSegmentosNegocio) - dataView.Sort = "Id ASC" - - DtSegmentosNegocio = dataView.ToTable - + If UsuarioActual.Empresa.UsaContabilidad Then + + Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa) + + If Cuenta.GetSegmentosNegocio(-1, "-1") Then + + DtSegmentosNegocio = Cuenta.DtResultados.FiltraParametros("Id > 0") + DtSegmentosNegocio.Rows.Add(New Object() {0, 0, " - ", "", ""}) + + Dim dataView As New DataView(DtSegmentosNegocio) + dataView.Sort = "Id ASC" + + DtSegmentosNegocio = dataView.ToTable + + End If + Cuenta.Dispose() + DdlSegmentoNegocio.DataSource = DtSegmentosNegocio : DdlSegmentoNegocio.DataBind() + DdlSegmentoNegocio.Items.Insert(0, New ListItem("-", "-1")) + End If - Cuenta.Dispose() - DdlSegmentoNegocio.DataSource = DtSegmentosNegocio : DdlSegmentoNegocio.DataBind() - DdlSegmentoNegocio.Items.Insert(0, New ListItem("-", "-1")) - For Each Gvr As GridViewRow In GvDatos.Rows - 'If Gvr.DataKey("IdSegNeg").ToEntero > 0 Then + 'For Each Gvr As GridViewRow In GvDatos.Rows + ' 'If Gvr.DataKey("IdSegNeg").ToEntero > 0 Then - ' 'COMENTADO PORQUE TRUENA | IPP - 17 AGOSTO 2017 - ' 'Dim Cuenta2 As New ClsContPAQi(UsuarioActual.Empresa) - ' 'If Cuenta2.GetSegmentosNegocio(Gvr.DataKey("IdSegNeg").ToEntero, "-1") Then - ' ' Dim DRES2 As DataRow - ' ' DRES2 = Cuenta2.DtResultados(0) - ' ' Gvr.Cells(1).Text = DRES2("Nombre").ToString - ' 'Else - ' ' Gvr.Cells(1).Text = "-" - ' 'End If - ' 'Cuenta2.Dispose() + ' ' 'COMENTADO PORQUE TRUENA | IPP - 17 AGOSTO 2017 + ' ' 'Dim Cuenta2 As New ClsContPAQi(UsuarioActual.Empresa) + ' ' 'If Cuenta2.GetSegmentosNegocio(Gvr.DataKey("IdSegNeg").ToEntero, "-1") Then + ' ' ' Dim DRES2 As DataRow + ' ' ' DRES2 = Cuenta2.DtResultados(0) + ' ' ' Gvr.Cells(1).Text = DRES2("Nombre").ToString + ' ' 'Else + ' ' ' Gvr.Cells(1).Text = "-" + ' ' 'End If + ' ' 'Cuenta2.Dispose() - ' 'If DtSegmentosNegocio IsNot Nothing AndAlso DtSegmentosNegocio.Rows.Count > 0 Then - ' ' Dim dr As DataRow - ' ' dr = DtSegmentosNegocio.FiltroPrimero(String.Format("Id ={0}", Gvr.DataKey("IdSegNeg"))) - ' ' Gvr.Cells(1).Text = dr("Nombre").ToString - ' 'End If + ' ' 'If DtSegmentosNegocio IsNot Nothing AndAlso DtSegmentosNegocio.Rows.Count > 0 Then + ' ' ' Dim dr As DataRow + ' ' ' dr = DtSegmentosNegocio.FiltroPrimero(String.Format("Id ={0}", Gvr.DataKey("IdSegNeg"))) + ' ' ' Gvr.Cells(1).Text = dr("Nombre").ToString + ' ' 'End If - 'Else - ' Gvr.Cells(1).Text = "0" - 'End If - Next + ' 'Else + ' ' Gvr.Cells(1).Text = "0" + ' 'End If + 'Next End Sub #End Region