CatTipo de gasto terminado
This commit is contained in:
@@ -2239,11 +2239,11 @@ Public Class ClsCompras
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "TIPOS DE GASTOS"
|
#Region "TIPOS DE GASTOS"
|
||||||
|
|
||||||
Public Function GetTipoGasto(CveTipoGasto As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetTipoGasto(CveTipoGasto As Integer, CveEmpresa As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Comp_TiposGastosGet")
|
DataAdapter("PA_Comp_TiposGastosGet")
|
||||||
@@ -2261,50 +2261,113 @@ Public Class ClsCompras
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function AddTipoGasto(TipoGasto As String, Estatus As Boolean, FechaIng As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Comp_TiposGastosAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||||
|
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||||
|
.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 el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function UpdateTipoGasto(CveTipoGasto As Integer, TipoGasto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Comp_TiposGastosUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
|
||||||
|
.Add("@TipoGasto", SqlDbType.NVarChar).Value = TipoGasto
|
||||||
|
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||||
|
.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 el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function RemoveTipoGasto(CveTipoGasto As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Comp_TiposGastosRemove")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el tipo de gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "VINCULAR PAGO"
|
#Region "VINCULAR PAGO"
|
||||||
'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
|
'Public Function GetVincularPago(CveProveedor As Integer, CveCompra As Integer, Tipo As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional CveTipoProveedor As Integer = -1) As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_Comp_VincularPagoGet")
|
' DataAdapter("PA_Comp_VincularPagoGet")
|
||||||
' With SqlAdapter.SelectCommand.Parameters
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
||||||
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
' .Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||||
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
|
' .Add("@Tipo", SqlDbType.Int).Value = Tipo
|
||||||
' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||||
' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||||
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
' .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
||||||
' End With
|
' End With
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As Exception
|
' Catch ex As Exception
|
||||||
' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
' OnError("Ocurrió un error al obtener los pagos a vincular.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
' End Try
|
' End Try
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
|
'Public Function GetVincularPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer) As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_Comp_VincularComplementoPagoGet")
|
' DataAdapter("PA_Comp_VincularComplementoPagoGet")
|
||||||
' With SqlAdapter.SelectCommand.Parameters
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
||||||
' .Add("@Monto", SqlDbType.Float).Value = Monto
|
' .Add("@Monto", SqlDbType.Float).Value = Monto
|
||||||
' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
|
' .Add("@XMLPagos", SqlDbType.Xml).Value = XMLPagos
|
||||||
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
' End With
|
' End With
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As Exception
|
' Catch ex As Exception
|
||||||
' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
' OnError("Ocurrió un error al obtener la vinculación de complemento de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
' End Try
|
' End Try
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
Public Function AddComplementoPago(CveIE As Integer, CveCompra As Integer, Importe As Decimal, CvePrePolizaDetalle As Integer, CveFactura As Integer) As Integer
|
Public Function AddComplementoPago(CveIE As Integer, CveCompra As Integer, Importe As Decimal, CvePrePolizaDetalle As Integer, CveFactura As Integer) As Integer
|
||||||
Dim Retorno As Integer = 0
|
Dim Retorno As Integer = 0
|
||||||
DataAdapter("PA_Comp_ComplementoPagoAdd")
|
DataAdapter("PA_Comp_ComplementoPagoAdd")
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
|||||||
|
|
||||||
private void CargaDatos()
|
private void CargaDatos()
|
||||||
{
|
{
|
||||||
ClsAC ObjAC = new ClsAC();
|
ClsCompras ObjCompras = new ClsCompras();
|
||||||
if (ObjAC.GetTipoGasto())
|
if (ObjCompras.GetTipoGasto(-1,UsuarioActual.CveEmpresa))
|
||||||
{
|
{
|
||||||
GvDatos.DataSource = ObjAC.DtResultados;
|
GvDatos.DataSource = ObjCompras.DtResultados;
|
||||||
GvDatos.DataBind();
|
GvDatos.DataBind();
|
||||||
}
|
}
|
||||||
ObjAC.Dispose();
|
ObjCompras.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e)
|
protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e)
|
||||||
@@ -46,7 +46,6 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
|||||||
BtnAgregarTipoGasto.Text = "Agregar";
|
BtnAgregarTipoGasto.Text = "Agregar";
|
||||||
TxtTipoGasto.Text = "";
|
TxtTipoGasto.Text = "";
|
||||||
ChkEstatus.Checked = true;
|
ChkEstatus.Checked = true;
|
||||||
ChkEstatus.Enabled = false;
|
|
||||||
UpModalTiposD.Update();
|
UpModalTiposD.Update();
|
||||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||||
}
|
}
|
||||||
@@ -66,23 +65,23 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
|||||||
{
|
{
|
||||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero();
|
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero();
|
||||||
ClsAC ObjAC = new ClsAC();
|
ClsCompras ObjCompras = new ClsCompras();
|
||||||
if (ObjAC.RemoveTipoGasto(CveTipoGasto))
|
if (ObjCompras.RemoveTipoGasto(CveTipoGasto))
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
UpDatos.Update();
|
UpDatos.Update();
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||||
Alert("Se eliminó el Tipo de Gasto correctamente");
|
Alert("Se eliminó el Tipo de Gasto correctamente");
|
||||||
}
|
}
|
||||||
ObjAC.Dispose();
|
ObjCompras.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e)
|
protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ClsAC ObjAC = new ClsAC();
|
ClsCompras ObjCompras = new ClsCompras();
|
||||||
if (BtnAgregarTipoGasto.Text == "Agregar")
|
if (BtnAgregarTipoGasto.Text == "Agregar")
|
||||||
{
|
{
|
||||||
if (ObjAC.AddTipoGasto(TxtTipoGasto.Text,UsuarioActual.CveUsuario))
|
if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa))
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
UpDatos.Update();
|
UpDatos.Update();
|
||||||
@@ -91,7 +90,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
|||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
if (ObjAC.UpdateTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,CveTipoGasto))
|
if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1))
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
UpDatos.Update();
|
UpDatos.Update();
|
||||||
@@ -99,6 +98,6 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
|||||||
Alert("Se actualizó el Tipo de Gasto correctamente");
|
Alert("Se actualizó el Tipo de Gasto correctamente");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ObjAC.Dispose();
|
ObjCompras.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user