OI Temas, Cat Checadores
This commit is contained in:
26
UserControl/OI/AddTema.ascx
Normal file
26
UserControl/OI/AddTema.ascx
Normal file
@@ -0,0 +1,26 @@
|
||||
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddTema.ascx.vb" Inherits="UserControl_AddProcedimiento" %>
|
||||
|
||||
<div id="DVAgregarTema" style="margin-top:-30px!important">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpModalAddTema" class="modal-content " tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span> </button>
|
||||
<h4 class="modal-title" style="text-align: left">
|
||||
<asp:Literal ID="Literal2" runat="server">Agregar Tema</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtTema" runat="server" CssClass="form-control" CausesValidation="true" TextMode="MultiLine" Rows="1"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtTema" runat="server" ControlToValidate="TxtTema" Display="None" ErrorMessage="El campo <b>''Tema''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="VGMAddTemaTN"></asp:RequiredFieldValidator>
|
||||
<asp:Label runat="server" Text="Tema" AssociatedControlID="TxtTema"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnAgregarTema" OnClick="BtnAgregarTema_Click" CssClass="btn btn-primary" ValidationGroup="VGMAddTemaTN" runat="server">Agregar</asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-danger">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
96
UserControl/OI/AddTema.ascx.vb
Normal file
96
UserControl/OI/AddTema.ascx.vb
Normal file
@@ -0,0 +1,96 @@
|
||||
Imports Extensiones
|
||||
Partial Class UserControl_AddProcedimiento
|
||||
Inherits System.Web.UI.UserControl
|
||||
|
||||
Public ReadOnly Property UsuarioActual As Usuario
|
||||
Get
|
||||
If Context.Session("UsuarioSIG") Is Nothing Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return DirectCast(Context.Session("UsuarioSIG"), Usuario)
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property CveProcedimiento As Integer
|
||||
Get
|
||||
If ViewState("CveProcedimiento") Is Nothing Then
|
||||
ViewState("CveProcedimiento") = -1
|
||||
End If
|
||||
Return ViewState("CveProcedimiento").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProcedimiento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Sub UserControl_AddProcedimiento_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ProcesoOK = False
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim CveProcedimientoNuevo As Integer = -1
|
||||
|
||||
If CveProcedimiento > 0 Then
|
||||
If ObjVentas.UpdateProcedimiento(CveProcedimiento, TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
'Alert($"Procedimiento Actualizado Correctamente.")
|
||||
ProcesoOK = True
|
||||
End If
|
||||
Else
|
||||
|
||||
CveProcedimientoNuevo = ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveProcedimientoNuevo > 0 Then
|
||||
ProcesoOK = True
|
||||
'TabProductos.Visible = True
|
||||
'TabVentas.Visible = True
|
||||
'LnkAgregarProducto.Visible = True
|
||||
'UpDatos.Update()
|
||||
'Alert($"Procedimiento Guardado Correctamente.")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If ProcesoOK Then
|
||||
ClsPaginas.Alert($"Procedimiento {If(CveProcedimiento > 0, "Actualizado", "Guardado")} Correctamente.")
|
||||
Dim AppNombre As String = $"GlobalDTProcedimientos-{UsuarioActual.CveEmpresa}"
|
||||
Application(AppNombre) = Nothing
|
||||
RegistraScript($"fncRegargaProcedimientos({CveProcedimientoNuevo});")
|
||||
RegistraScript("$('#BtnCancelarProcedimiento').click();")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub LimpiarControles()
|
||||
TxtProcedimiento.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAgregarTema_Click(sender As Object, e As EventArgs)
|
||||
Using objoi As New ClsOIEventos()
|
||||
If objoi.AddRevisionesEventos(TxtTema.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
Alert(String.Format("El Tema ""{0}"" fue agregado con éxito.", TxtTema.Text.Trim()), ModExtensiones.TipoMensaje.MsgInformacion)
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide')", iddivAgregarTema))
|
||||
TxtTema.Text = ""
|
||||
GlobalDTOIRevision(UsuarioActual.CveEmpresa, objoi.DtResultados)
|
||||
CargaTemas()
|
||||
UpContenido.Update()
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar la revisión. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError)
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user