Commit inicial Ventas Productivo
This commit is contained in:
217
Acumuladores/CatFoliosGarantia.aspx.vb
Normal file
217
Acumuladores/CatFoliosGarantia.aspx.vb
Normal file
@@ -0,0 +1,217 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Acumuladores_CatFoliosGarantia
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveFolioGarantia As Integer
|
||||
Get
|
||||
If Not ViewState("CveFolioGarantia") Is Nothing Then
|
||||
Return ViewState("CveFolioGarantia").ToString.ToEntero
|
||||
Else
|
||||
Return -1
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveFolioGarantia") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Private Property Actualizar As Boolean
|
||||
Get
|
||||
If Not ViewState("Actualizar") Is Nothing Then
|
||||
Return DirectCast(ViewState("Actualizar"), Boolean)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Actualizar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
CargadatosGvFolioGarantia()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region "Folios Garantía"
|
||||
|
||||
Private Sub CargadatosGvFolioGarantia()
|
||||
|
||||
Dim objAcum As New ClsAcumuladores
|
||||
|
||||
If objAcum.FoliosGarantiaGet(-1, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
GvFolioGarantia.DataSource = objAcum.DtResultados
|
||||
Else
|
||||
GvFolioGarantia.DataSource = Nothing
|
||||
End If
|
||||
|
||||
objAcum.Dispose()
|
||||
|
||||
UPGvFolioGarantia.DataBind()
|
||||
UpGral.Update()
|
||||
|
||||
'CargaGvTamanioBitacora()
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub CargaGvTamanioBitacora()
|
||||
|
||||
' Dim objAcum As New ClsAcumuladores
|
||||
|
||||
' If objAcum.TamañoBitacoraGet(UsuarioActual.Empresa.CveEmpresa) Then
|
||||
' GvBitacora.DataSource = objAcum.DtResultados
|
||||
' Else
|
||||
' GvBitacora.DataSource = Nothing
|
||||
' End If
|
||||
|
||||
' objAcum.Dispose()
|
||||
|
||||
' UpGvBitacora.DataBind()
|
||||
' UpGral.Update()
|
||||
|
||||
|
||||
'End Sub
|
||||
Protected Sub BtnAgregarFolioGarantia_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantia.Click
|
||||
LtlTituloModalFolioGarantia.Text = "Agregar Folio Garantía"
|
||||
BtnAgregarFolioGarantiaModal.Text = "Agregar"
|
||||
|
||||
TxtFolioGarantia.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
|
||||
Actualizar = False
|
||||
UpGral.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolioGarantia"))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click
|
||||
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
|
||||
'Dim Cargo, Bonificacion, Compra, Puntos As Decimal
|
||||
|
||||
'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1)
|
||||
'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1)
|
||||
'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1)
|
||||
'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1)
|
||||
|
||||
|
||||
If Not Actualizar Then
|
||||
If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
TxtFolioGarantia.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
'TxtCargo.Text = ""
|
||||
'TxtBonificacion.Text = ""
|
||||
'TxtCompra.Text = ""
|
||||
'TxtPuntos.Text = ""
|
||||
|
||||
CargadatosGvFolioGarantia()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolioGarantia"), "jsHideModalFolioGarantia")
|
||||
UpGral.Update()
|
||||
|
||||
Alert("Folio de Garantía Agregado Correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, If(ChkEstatus.Checked = True, 1, 0), UsuarioActual.CveUsuario) Then
|
||||
|
||||
TxtFolioGarantia.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
'TxtCargo.Text = ""
|
||||
'TxtBonificacion.Text = ""
|
||||
'TxtCompra.Text = ""
|
||||
'TxtPuntos.Text = ""
|
||||
|
||||
CargadatosGvFolioGarantia()
|
||||
UpModalFolioGarantia.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolioGarantia"), "jsHideModalFolioGarantia")
|
||||
|
||||
UpGral.Update()
|
||||
Alert("Folio de Garantía Actualizado Correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al Actualizar el Folio de Garantía", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
CveFolioGarantia = -1
|
||||
Actualizar = False
|
||||
|
||||
ObjAcum.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Remove_ClickFolioGarantia(sender As Object, e As EventArgs)
|
||||
|
||||
Dim objAcum As New ClsAcumuladores
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim activo As Boolean = 0
|
||||
Dim CveCapacitador As Integer = GvRow.DataKey("CveFolioGarantia")
|
||||
|
||||
If objAcum.FoliosGarantiaRemove(CveCapacitador, UsuarioActual.CveEmpresa) Then
|
||||
CargadatosGvFolioGarantia()
|
||||
|
||||
Alert("Capacitador Eliminó Correctamente ", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al Eliminar el Folio de Garantía", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
objAcum.Dispose()
|
||||
|
||||
CargadatosGvFolioGarantia()
|
||||
|
||||
CveFolioGarantia = -1
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_ClickFolioGarantia(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim activo As Boolean = 0
|
||||
|
||||
LtlTituloModalFolioGarantia.Text = "Editar Folio Garantía"
|
||||
Actualizar = True
|
||||
|
||||
CveFolioGarantia = GvRow.DataKey("CveFolioGarantia")
|
||||
|
||||
TxtFolioGarantia.Text = GvRow.DataKey("FolioGarantia")
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False)
|
||||
'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00")
|
||||
'TxtBonificacion.Text = GvRow.DataKey("Bonificacion").ToDecimal.ToString("###,###,###.00")
|
||||
'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")
|
||||
'TxtPuntos.Text = GvRow.DataKey("Puntos").ToDecimal.ToString("###,###,###.00")
|
||||
|
||||
'DdlPS.Items.Clear()
|
||||
'DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
|
||||
'DdlPS.DataBind()
|
||||
'DdlPS.SelectedValueExist(GvRow.DataKey("CvePSCargo").ToEntero)
|
||||
|
||||
BtnAgregarFolioGarantiaModal.Text = "Actualizar"
|
||||
|
||||
UpModalFolioGarantia.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarFolioGarantia"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user