This commit is contained in:
rrene
2020-08-14 21:27:56 -07:00
2 changed files with 261 additions and 2 deletions

View File

@@ -3434,6 +3434,264 @@ Public Class ClsAF
#End Region
#Region "TIPO SERVICIO"
Public Function GetTiposServicios(CveTipoServicio As Integer, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServicioGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddTiposServicios(Nombre As String, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServicioAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@Nombre", SqlDbType.NVarChar).Value = Nombre
.Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateTiposServicios(CveTipoServicio As Integer, Nombre As String, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServicioUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@Nombre", SqlDbType.NVarChar).Value = Nombre
.Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function DeleteTiposServicios(CveTipoServicio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServicioDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddTiposServiciosActividades(CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
.Add("@Duracion", SqlDbType.Int).Value = Duracion
.Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
.Add("@CveActividad", SqlDbType.Int).Value = CveActividad
.Add("@Duracion", SqlDbType.Int).Value = Duracion
.Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function DeleteTiposServiciosActividades(CveTipoServicioActividad As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosActividadesDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los materiales de los tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddTiposServiciosMaterial(CveTipoServicio As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer,
Tipo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Tipo", SqlDbType.TinyInt).Value = Tipo
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer,
Tipo As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial
.Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@CveUM", SqlDbType.Int).Value = CveUM
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Tipo", SqlDbType.TinyInt).Value = Tipo
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function DeleteTiposServiciosMaterial(CveTipoServicioMaterial As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposServiciosMaterialDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las actividades tipos servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region " IDisposable Support "
' IDisposable

View File

@@ -114,14 +114,15 @@
<asp:BoundField HeaderText="Comisión $" DataField="ComisionGanancia" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Cobrado" DataField="Cobrado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="% Cobro" DataField="PorcentajePagado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cobrado Anual" DataField="CobradoAnual" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pendiente x Cobrar" DataField="ImportePorCobrar" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pago" DataField="Pago" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Venta Acumulado" DataField="ImporteVentaAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField HeaderText="Importe Venta Acumulado" DataField="ImporteVentaAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Comisión Acumulada $" DataField="ComisionGananciaAcumulada" DataFormatString="{0:###,###,##0.00}" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="% Cobro Acumulado" DataField="PorcentajePagadoAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Importe Cobrado Acumulado" DataField="CobradoAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pago Acumulado" DataField="PagoAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Pago Acumulado" DataField="PagoAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />--%>
<%--<asp:BoundField HeaderText="Importe Pago" DataField="ImportePagoAcumulado" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />--%>
<asp:BoundField HeaderText="Pendiente Pago" DataField="PendientePago" ItemStyle-Width="15%" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>