Contratos

This commit is contained in:
Rakcsle Supertramp
2020-12-09 17:20:51 -07:00
parent 5912949dd5
commit 453fcb4781
5 changed files with 233 additions and 134 deletions

View File

@@ -1309,8 +1309,14 @@ Public Class ClsInventarios
Retorno = True
End If
Catch Ex1 As SqlException
If Ex1.Message.Contains("50019") Then
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then
Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
If Ex1.Message.Contains("50021") Then
Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
@@ -1437,7 +1443,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer) As Boolean
Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosTransitoriosGet")
@@ -1448,6 +1454,7 @@ Public Class ClsInventarios
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@CveUsuarioResponsable", SqlDbType.Int).Value = CveUsuarioResponsable
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %>
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
@@ -1048,6 +1048,28 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<%--<asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
@@ -1120,6 +1142,30 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<%-- <asp:TemplateField HeaderText="Período Actual">
<ItemTemplate>
<asp:HyperLink ID="HLActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
@@ -1192,6 +1238,30 @@
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:TemplateField HeaderText="Acumulado">
<ItemTemplate>
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>

View File

@@ -1821,7 +1821,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Row = DtGastosSubProyectoH.NewRow
If DtGastosSubProyectoH.Rows.Count > 0 Then
If DtGastosSubProyectoH.Rows.Count > 1 Then
IndexData = 0

View File

@@ -2793,10 +2793,14 @@
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:LinkButton ID="BtnDecargaFormato" runat="server" ClientIDMode="Static" Text="<i class='fa fa-download' aria-hidden='true'></i> Formato" CssClass="btn btn-warning" OnClick="BtnDecargaFormato_Click" />
<asp:Button ID="BtnCargaPresupuesto" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnCargaPresupuesto_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDecargaFormato" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>

View File

@@ -4129,13 +4129,31 @@ Partial Class Contratos_ContratoObra
DTCargaPresupuesto = CargaPreSupuestoExcel()
If DTCargaPresupuesto.Rows.Count > 0 Then
' ProcesaDatosCargaPresupuesto(DTCargaPresupuesto)
ProcesaDatosCargaPresupuesto(DTCargaPresupuesto)
Else
Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia)
End If
End Sub
Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs)
Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx")
If FI.Exists Then
Response.ContentType = "application/octet-stream"
Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx")
Response.TransmitFile(FI.FullName)
Response.End()
End If
End Sub
Private Function CargaPreSupuestoExcel() As DataTable
@@ -4183,179 +4201,179 @@ Partial Class Contratos_ContratoObra
End Function
'Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable)
Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable)
' Dim DTPS = New DataTable
' DTPS.Columns.Add("CveContratoDetalle", GetType(Integer))
' DTPS.Columns.Add("Cantidad", GetType(Double))
' DTPS.Columns.Add("CantidadContratada", GetType(Double))
' DTPS.Columns.Add("CveUM", GetType(Integer))
' DTPS.Columns.Add("UM", GetType(String))
' DTPS.Columns.Add("CveClasificacion", GetType(Integer))
' DTPS.Columns.Add("Clasificacion", GetType(String))
' DTPS.Columns.Add("CvePS", GetType(Integer))
' DTPS.Columns.Add("PS", GetType(String))
' DTPS.Columns.Add("CodigoPS", GetType(String))
' DTPS.Columns.Add("PU", GetType(Double))
' DTPS.Columns.Add("Total", GetType(Double))
' DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer))
' DTPS.Columns.Add("PermitirAvance", GetType(Integer))
' DTPS.Columns.Add("PermitirEstimacion", GetType(Integer))
' DTPS.Columns.Add("UsuarioAvance", GetType(Integer))
' DTPS.Columns.Add("Cantidad_Original", GetType(Double))
' DTPS.Columns.Add("PU_Original", GetType(Double))
' DTPS.Columns.Add("Total_Original", GetType(Double))
' DTPS.Columns.Add("NoIdentificacion", GetType(String))
' DTPS.Columns.Add("LimitarCantidad", GetType(Integer))
' DTPS.Columns.Add("OCInterna", GetType(String))
' DTPS.Columns.Add("Observacion", GetType(String))
Dim DTPS = New DataTable
DTPS.Columns.Add("CveContratoDetalle", GetType(Integer))
DTPS.Columns.Add("Cantidad", GetType(Double))
DTPS.Columns.Add("CantidadContratada", GetType(Double))
DTPS.Columns.Add("CveUM", GetType(Integer))
DTPS.Columns.Add("UM", GetType(String))
DTPS.Columns.Add("CveClasificacion", GetType(Integer))
DTPS.Columns.Add("Clasificacion", GetType(String))
DTPS.Columns.Add("CvePS", GetType(Integer))
DTPS.Columns.Add("PS", GetType(String))
DTPS.Columns.Add("CodigoPS", GetType(String))
DTPS.Columns.Add("PU", GetType(Double))
DTPS.Columns.Add("Total", GetType(Double))
DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer))
DTPS.Columns.Add("PermitirAvance", GetType(Integer))
DTPS.Columns.Add("PermitirEstimacion", GetType(Integer))
DTPS.Columns.Add("UsuarioAvance", GetType(Integer))
DTPS.Columns.Add("Cantidad_Original", GetType(Double))
DTPS.Columns.Add("PU_Original", GetType(Double))
DTPS.Columns.Add("Total_Original", GetType(Double))
DTPS.Columns.Add("NoIdentificacion", GetType(String))
DTPS.Columns.Add("LimitarCantidad", GetType(Integer))
DTPS.Columns.Add("OCInterna", GetType(String))
DTPS.Columns.Add("Observacion", GetType(String))
' Dim RowNoEncontrados As String = ""
Dim RowNoEncontrados As String = ""
' For Each DrowPS As DataRow In DTPresupuesto.Rows
For Each DrowPS As DataRow In DTPresupuesto.Rows
' Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c)
' Dim CvePS As Integer
' Dim CveUM As Integer
Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c)
Dim CvePS As Integer
Dim CveUM As Integer
' If StrArray.Length > 0 Then
' If CBool(StrArray(0)) = True Then
' CvePS = StrArray(1).ToEntero
' Else
' RowNoEncontrados &= StrArray(1) & "<\BR>"
' End If
' End If
If StrArray.Length > 0 Then
If CBool(StrArray(0)) = True Then
CvePS = StrArray(1).ToEntero
Else
RowNoEncontrados &= StrArray(1) & "<\BR>"
End If
End If
' If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then
' CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero
' Dim Row As DataRow = DTPS.NewRow()
' Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
' Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
' Row("CveUM") = CveUM
' Row("UM") = ""
' Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
' Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
' Row("CvePS") = CvePS
' Row("PS") = DrowPS("PS").ToString
' Row("CodigoPS") = DrowPS("PS").ToString
' Row("PU") = DrowPS("PU").ToString.ToDouble
' Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
Dim Row As DataRow = DTPS.NewRow()
Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble
Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble
Row("CveUM") = CveUM
Row("UM") = ""
Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero
Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString
Row("CvePS") = CvePS
Row("PS") = DrowPS("PS").ToString
Row("CodigoPS") = DrowPS("PS").ToString
Row("PU") = DrowPS("PU").ToString.ToDouble
Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble
' Select Case TipoCargaPresupuesto
' Case EnumTipoCargaPresupuesto.Ventas
' Row("CveTipoPresupuesto") = 2
' Exit Select
' Case EnumTipoCargaPresupuesto.Control
' Row("CveTipoPresupuesto") = 1
' Exit Select
' Case Else
' Row("CveTipoPresupuesto") = 1
' End Select
Select Case TipoCargaPresupuesto
Case EnumTipoCargaPresupuesto.Ventas
Row("CveTipoPresupuesto") = 2
Exit Select
Case EnumTipoCargaPresupuesto.Control
Row("CveTipoPresupuesto") = 1
Exit Select
Case Else
Row("CveTipoPresupuesto") = 1
End Select
' Row("NoIdentificacion") = ""
' Row("OCInterna") = ""
' Row("LimitarCantidad") = 0
' Row("Observacion") = ""
Row("NoIdentificacion") = ""
Row("OCInterna") = ""
Row("LimitarCantidad") = 0
Row("Observacion") = ""
' DTPS.Rows.Add(Row)
DTPS.Rows.Add(Row)
' End If
' Next
End If
Next
' Dim ErrorProceso = False
' Dim ObjContratos As New ClsContratos
' Dim TotalRow As Double = 0
' ObjContratos.IniciaTransacSQL()
Dim ErrorProceso = False
Dim ObjContratos As New ClsContratos
Dim TotalRow As Double = 0
ObjContratos.IniciaTransacSQL()
' For Each Row As DataRow In DTPS.Rows
For Each Row As DataRow In DTPS.Rows
' If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then
' If Autorizado Then
' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
' guardarBitacora(msj)
' End If
If Autorizado Then
Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"))
guardarBitacora(msj)
End If
' Dim NrowTmpDT As DataRow = TmpDT.NewRow
Dim NrowTmpDT As DataRow = TmpDT.NewRow
' NrowTmpDT("Cantidad") = Row("Cantidad")
' NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
' NrowTmpDT("CveUM") = Row("CveUM")
' NrowTmpDT("UM") = Row("UM")
' NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
' NrowTmpDT("Clasificacion") = Row("Clasificacion")
' NrowTmpDT("CvePS") = Row("CvePS")
' NrowTmpDT("PS") = Row("PS")
' NrowTmpDT("CodigoPS") = Row("CodigoPS")
' NrowTmpDT("PU") = Row("PU")
' NrowTmpDT("Total") = Row("Total")
' NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
' NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
' NrowTmpDT("OCInterna") = Row("OCInterna")
' NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
' NrowTmpDT("Observacion") = Row("Observacion")
NrowTmpDT("Cantidad") = Row("Cantidad")
NrowTmpDT("CantidadContratada") = Row("CantidadContratada")
NrowTmpDT("CveUM") = Row("CveUM")
NrowTmpDT("UM") = Row("UM")
NrowTmpDT("CveClasificacion") = Row("CveClasificacion")
NrowTmpDT("Clasificacion") = Row("Clasificacion")
NrowTmpDT("CvePS") = Row("CvePS")
NrowTmpDT("PS") = Row("PS")
NrowTmpDT("CodigoPS") = Row("CodigoPS")
NrowTmpDT("PU") = Row("PU")
NrowTmpDT("Total") = Row("Total")
NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto")
NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion")
NrowTmpDT("OCInterna") = Row("OCInterna")
NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad")
NrowTmpDT("Observacion") = Row("Observacion")
' NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle")
' TmpDT.Rows.Add(NrowTmpDT)
' TmpDT.AcceptChanges()
TmpDT.Rows.Add(NrowTmpDT)
TmpDT.AcceptChanges()
' TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
' Else
' ErrorProceso = True
' Exit For
' End If
' Next
TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble
Else
ErrorProceso = True
Exit For
End If
Next
' If ErrorProceso Then
' ObjContratos.RollBack()
' Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
' Else
If ErrorProceso Then
ObjContratos.RollBack()
Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError)
Else
' ObjContratos.Commit()
' Alert("Presupuesto Cargado correctamente")
ObjContratos.Commit()
Alert("Presupuesto Cargado correctamente")
' Select Case TipoCargaPresupuesto
' Case EnumTipoCargaPresupuesto.Ventas
' CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
' UpGV.Update()
' Exit Select
' Case EnumTipoCargaPresupuesto.Control
' CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
' UpGVInsumos.Update()
' Exit Select
' Case Else
Select Case TipoCargaPresupuesto
Case EnumTipoCargaPresupuesto.Ventas
CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2"))
UpGV.Update()
Exit Select
Case EnumTipoCargaPresupuesto.Control
CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1"))
UpGVInsumos.Update()
Exit Select
Case Else
' End Select
End Select
' LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
' LblImporte.Text = LbTotalGeneral.Text
' UpGral.Update()
LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero
LblImporte.Text = LbTotalGeneral.Text
UpGral.Update()
' End If
End If
' ObjContratos.Dispose()
ObjContratos.Dispose()
' If RowNoEncontrados.Length > 0 Then
' Alert($"Productos no encontrados <br> {RowNoEncontrados} ")
' End If
If RowNoEncontrados.Length > 0 Then
Alert($"Productos no encontrados <br> {RowNoEncontrados} ")
End If
'End Sub
End Sub