diff --git a/General/ColectivasDetalle.aspx.vb b/General/ColectivasDetalle.aspx.vb index 8aa062018..3369f1cc0 100644 --- a/General/ColectivasDetalle.aspx.vb +++ b/General/ColectivasDetalle.aspx.vb @@ -42,23 +42,23 @@ Partial Class General_ColectivasDetalle End Set End Property #End Region - Private Sub CargaCuentasContables() - Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - If ObjContabilidad.GetCuentas(-1, "-1", -1) Then - DtCuentasContables = ObjContabilidad.DtResultados - DdlCtaContColectivas.DataSource = ObjContabilidad.DtResultados - DdlCtaContColectivas.DataBind() - Else - DtCuentasContables = Nothing - End If - ObjContabilidad.Dispose() + 'Private Sub CargaCuentasContables() + ' Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) + ' If ObjContabilidad.GetCuentas(-1, "-1", -1) Then + ' DtCuentasContables = ObjContabilidad.DtResultados + ' DdlCtaContColectivas.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContColectivas.DataBind() + ' Else + ' DtCuentasContables = Nothing + ' End If + ' ObjContabilidad.Dispose() - End Sub + 'End Sub Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContables() + 'If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContables() If Request("CveColectiva") IsNot Nothing AndAlso IsNumeric(Request("CveColectiva")) AndAlso Request("CveColectiva").ToEntero > 0 Then ViewState("CveColectiva") = Request("CveColectiva") @@ -81,7 +81,7 @@ Partial Class General_ColectivasDetalle Private Sub CargarDatos() Dim ObjColectivasDetalle As New ClsGenerales - If ObjColectivasDetalle.GetColectivas(CveColectiva, "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then + If ObjColectivasDetalle.GetColectivas(UsuarioActual.CveEmpresa, CveColectiva) Then If ObjColectivasDetalle.DtResultados.Rows.Count > 0 Then TxtColectiva.Text = ObjColectivasDetalle.Colectiva TxtCodigo.Text = ObjColectivasDetalle.Codigo @@ -90,11 +90,10 @@ Partial Class General_ColectivasDetalle TxtTelefono.Text = ObjColectivasDetalle.Telefono TxtCorreo.Text = ObjColectivasDetalle.Correo DdlTipo.SelectedValue = ObjColectivasDetalle.Tipo.ToString - DdlCtaContColectivas.SelectedValue = ObjColectivasDetalle.IdCtaContable.ToString ChkEstado.Checked = ObjColectivasDetalle.Estatus LblFechaCaptura.Text = ObjColectivasDetalle.FechaIng.ToString LblUsuarioCapturo.Text = ObjColectivasDetalle.Usuario - + End If End If End Sub @@ -102,11 +101,11 @@ Partial Class General_ColectivasDetalle Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Dim ObjColectivasDetalle As New ClsGenerales Dim ObjCuentasDeposito As New ClsGenerales(ObjColectivasDetalle.IniciaTransacSQL()) - Dim ErrorBancos = False + Dim ErrorBancos As Boolean = False If CveColectiva = -1 Then If ObjColectivasDetalle.AddColectivas(TxtColectiva.Text.Trim, TxtCodigo.Text.Trim, TxtRFC.Text.Trim, TxtDireccion.Text.Trim, TxtTelefono.Text.Trim, TxtCorreo.Text.Trim, DdlCtaContColectivas.SelectedValue.ToEntero, DdlCtaContColectivas.SelectedItem.ToString, DdlTipo.SelectedValue.ToEntero.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - Dim NuevoCveColectiva = ObjColectivasDetalle.CveColectiva + Dim NuevoCveColectiva As Integer = ObjColectivasDetalle.CveColectiva ''Agregar Cuentas Bancarias If TempDTCuentasBancos.Rows.Count > 0 Then @@ -118,7 +117,7 @@ Partial Class General_ColectivasDetalle Next End If - If ObjColectivasDetalle.GetColectivas(CveColectiva, "-1", "-1", "-1", -1) Then + If ObjColectivasDetalle.GetColectivas(UsuarioActual.CveEmpresa, CveColectiva) Then GlobalDTGralColectivas(-1) = ObjColectivasDetalle.DtResultados Else ErrorBancos = True @@ -265,7 +264,7 @@ Partial Class General_ColectivasDetalle If e.Row.RowType = DataControlRowType.DataRow Then If CveColectiva < 0 Then - For index = 1 To TempDTCuentasBancos.Rows.Count + For index As Integer = 1 To TempDTCuentasBancos.Rows.Count TempDTCuentasBancos.Rows(index - 1)("CveCuentaDeposito") = index Next TempDTCuentasBancos.AcceptChanges() @@ -283,14 +282,14 @@ Partial Class General_ColectivasDetalle Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating - Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim - Dim NumeroSucursal = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim - Dim CLABE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim - Dim SWIFT = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim - Dim Plaza = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim - Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim - Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim - Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim + Dim NombreBanco As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim + Dim NumeroSucursal As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim + Dim CLABE As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim + Dim SWIFT As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim + Dim Plaza As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim + Dim NumeroCuenta As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim + Dim ConvenioCIE As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim + Dim Referencia As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim Dim ObjCuentasBancos As New ClsGenerales If CveColectiva > 0 Then @@ -301,7 +300,7 @@ Partial Class General_ColectivasDetalle End If Else - Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1 + Dim index As Integer = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1 Dim Row As DataRow = TempDTCuentasBancos.Rows(index) Row("BancoNombre") = NombreBanco Row("Sucursal") = NumeroSucursal @@ -329,7 +328,7 @@ Partial Class General_ColectivasDetalle End If Else - Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1 + Dim index As Integer = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1 TempDTCuentasBancos.Rows.RemoveAt(index) End If