Nuevo catalogo agregado sobre la tabla CobranzaEstatus
This commit is contained in:
87
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
87
Ventas/CatCobranzaEstatus.aspx.vb
Normal file
@@ -0,0 +1,87 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Vta_CatCobranzaEstatus
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveCobranzaEstatus As Integer
|
||||
Get
|
||||
Return ViewState("CveCobranzaEstatus").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCobranzaEstatus") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub page_load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetCobranzaEstatus(UsuarioActual.CveEmpresa) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatus_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatus.Click
|
||||
TxtEstatusCobranza.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
BtnAgregarEstatusCobranza.Text = "Agregar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
CveCobranzaEstatus = GvRow.DataKey("CveCobranzaEstatus").ToEntero
|
||||
TxtEstatusCobranza.Text = GvRow.DataKey("CobranzaEstatus").ToString
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus")
|
||||
BtnAgregarEstatusCobranza.Text = "Actualizar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusCobranza"))
|
||||
End Sub
|
||||
|
||||
Public Sub BtnAgregarEstatusCobranza_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusCobranza.Click
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If BtnAgregarEstatusCobranza.Text = "Agregar" Then
|
||||
If ObjVentas.AddCobranzaEstatus(TxtEstatusCobranza.Text, UsuarioActual.CveEmpresa, ChkEstatus.Checked, UsuarioActual.CveUsuario) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al agregar")
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.UpdateCobranzaEstatus(CveCobranzaEstatus, TxtEstatusCobranza.Text, ChkEstatus.Checked) Then
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddEstatusCobranza"))
|
||||
Alert("Estatus agregado con exito")
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Else
|
||||
Alert("Error al actualizar")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveCobranzaEstatus").ToEntero
|
||||
|
||||
If ObjVentas.RemoveCobranzaEstatus(CveEstatusOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
Alert("Estatus de cobranza eliminado")
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user