Ventas Medicas Pago directo inicial
This commit is contained in:
163
Ventas/CatMedicos.aspx.vb
Normal file
163
Ventas/CatMedicos.aspx.vb
Normal file
@@ -0,0 +1,163 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
|
||||
Partial Class Ventas_CatMedicos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property CveMedico As Integer
|
||||
Get
|
||||
If ViewState("CveMedico") Is Nothing Then
|
||||
ViewState("CveMedico") = -1
|
||||
End If
|
||||
Return ViewState("CveMedico").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMedico") = value
|
||||
End Set
|
||||
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 ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetMedicos(-1, UsuarioActual.CveEmpresa, -1) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ProcesoOK = False
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
|
||||
If CveMedico > 0 Then
|
||||
If ObjVentas.UpdateMedico(CveMedico, TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.AddMedico(TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If ProcesoOK Then
|
||||
Alert($"Medico {If(CveMedico > 0, "Actualizado", "Guardado")} Correctamente.")
|
||||
RegistraScript("$('#DVAgregarMedico').modal('hide');")
|
||||
CargaDatos()
|
||||
CargaGlobal()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
|
||||
|
||||
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
CveMedico = GvRow.DataKey("CveMedico").ToEntero
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ProcesoOK = False
|
||||
|
||||
If ObjVentas.RemoveMedico(CveMedico, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
If ProcesoOK Then
|
||||
Alert("Medico eliminando correctamente.")
|
||||
|
||||
CargaDatos()
|
||||
CargaGlobal()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "CARGA GLOBAL"
|
||||
Private Sub CargaGlobal()
|
||||
GlobalDTMedicos(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Public Sub LnkAgregarMedico_Click(sender As Object, e As EventArgs)
|
||||
|
||||
LbAgregar.Text = "Agregar"
|
||||
LtlTituloModal.Text = "Agregar Medico"
|
||||
|
||||
TxtMedico.Text = ""
|
||||
TxtCedulaProfecional.Text = ""
|
||||
TxtFechaNacimiento.Text = ""
|
||||
TxtNotas.Text = ""
|
||||
TxtDiasAtencion.Text = ""
|
||||
TxtHorario.Text = ""
|
||||
TxtLugar.Text = ""
|
||||
|
||||
DVEstatus.Visible = False
|
||||
ChkEstatus.Checked = True
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
CveMedico = -1
|
||||
|
||||
RegistraScript("$('#DVAgregarMedico').modal();")
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
CveMedico = GvRow.DataKey("CveMedico").ToEntero
|
||||
|
||||
TxtMedico.Text = GvRow.DataKey("Medico")
|
||||
TxtCedulaProfecional.Text = GvRow.DataKey("CedulaProfesional")
|
||||
TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToDate().ToString("dd/MM/yyyy")
|
||||
TxtNotas.Text = GvRow.DataKey("Notas")
|
||||
TxtDiasAtencion.Text = GvRow.DataKey("DiasAtencion")
|
||||
TxtHorario.Text = GvRow.DataKey("Horario")
|
||||
TxtLugar.Text = GvRow.DataKey("Lugar")
|
||||
ChkEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus"))
|
||||
|
||||
DVEstatus.Visible = True
|
||||
LbAgregar.Text = "Actualizar"
|
||||
LtlTituloModal.Text = $"Actualizar Medico {TxtCedulaProfecional.Text}"
|
||||
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#DVAgregarMedico').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user