diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index 410a4db11..95fa81a74 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -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 diff --git a/Ventas/RepComisiones.aspx b/Ventas/RepComisiones.aspx index bedffe731..1312337bb 100644 --- a/Ventas/RepComisiones.aspx +++ b/Ventas/RepComisiones.aspx @@ -114,14 +114,15 @@ + - + <%-- - + --%> <%----%>