Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,129 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Bancos_CuentasBancarias
Inherits ClsPaginas
'Configuración
Private ReadOnly Property CveCuenta As Integer
Get
Return ViewState("CveCuenta").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1) Then
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
Me.GvDatos.DataSource = Nothing
End If
ObjBancos.Dispose()
CargaGrid("")
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(1).Width = Unit.Pixel(75) 'CveBanco
e.Row.Cells(2).Width = Unit.Pixel(70) 'NumCuenta
e.Row.Cells(3).Width = Unit.Pixel(120) 'clabe
e.Row.Cells(4).Width = Unit.Pixel(50) 'Moneda
e.Row.Cells(5).Width = Unit.Pixel(51) 'FInicial
e.Row.Cells(6).Width = Unit.Pixel(60) 'estatus
e.Row.Cells(7).Width = Unit.Pixel(50) 'fecha
e.Row.Cells(8).Width = Unit.Pixel(50) 'Usuario
End If
e.Row.FCLiteral("LtlNumCuenta").Text = "<a class=""Texto"" target=""_blank"" href=""/Bancos/CuentasBancariasDetalle.aspx?CveCuenta=" & e.Row.DBCampo("CveCuenta") & """>" & e.Row.FCLiteral("LtlNumCuenta").Text & "</a>"
e.Row.FCLiteral("LtlBanco").Text = "<a class=""Texto"" target=""_blank"" href=""/Bancos/CuentasBancariasDetalle.aspx?CveCuenta=" & e.Row.DBCampo("CveCuenta") & """>" & e.Row.FCLiteral("LtlBanco").Text & "</a>"
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjBancos As New ClsBancos
If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If ObjBancos.GetBancosCuentasUsuarios(-1) Then
GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados
End If
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjBancos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
'Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
' Dim ObjBancos As New ClsBancos
' Dim CveBanco As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlCveBanco"), DropDownList).SelectedValue.ToEntero
' Dim NumCuenta As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtNumCuenta"), TextBox).Text.Trim
' Dim CLABE As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCLABE"), TextBox).Text.Trim
' Dim CveMoneda As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlCveMoneda"), DropDownList).SelectedValue.ToEntero
' Dim DiaCorte As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtDiaCorte"), TextBox).Text.Trim.ToEntero
' Dim FInicial As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFInicial"), TextBox).Text.Trim.ToEntero
' Dim FActual As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFActual"), TextBox).Text.Trim.ToEntero
' Dim FFinal As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFFinal"), TextBox).Text.Trim.ToEntero
' Dim IdCtaContable As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtIdCtaContable"), TextBox).Text.Trim.ToEntero
' Dim FormatoCheque As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFormatoCheque"), TextBox).Text.Trim
' Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
' Dim CveCuenta As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
' If ObjBancos.UpdateBancosCuentas(CveBanco, NumCuenta, CLABE, CveMoneda, DiaCorte, FInicial, FActual, FFinal, IdCtaContable, FormatoCheque, Estatus, CveCuenta) Then
' GvDatos.EditIndex = -1
' ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
' End If
' ObjBancos.Dispose()
' If ViewState("Orden").ToString() <> String.Empty Then
' CargaGrid(ViewState("Orden").ToString())
' Else
' CargaGrid("")
' End If
'End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTBancosCuentas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTBancosCuentas"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
End Class