Commit inicial Ventas Productivo
This commit is contained in:
95
Planeacion/Temporal/RegBoletas.aspx
Normal file
95
Planeacion/Temporal/RegBoletas.aspx
Normal file
@@ -0,0 +1,95 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegBoletas.aspx.vb" Inherits="Temporal_RegBoletas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Registro de boletas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UpRegBoletas" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light smmallpadding bordered ">
|
||||
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Boleta:</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtBoleta" runat="server" CssClass="form-control input-sm" ValidationGroup="GrpGuardar"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtBoleta" FilterType="Custom, Numbers" />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtBoleta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Boleta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRecibir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<asp:LinkButton ID="LbAgregarBoleta" ValidationGroup="GrpRecibir" runat="server" CssClass="btn btn-circle btn-sm green" Text="+"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trConsejero" runat="server" visible="false">
|
||||
<td>No. Consejero:</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtConsejero" runat="server" CssClass="form-control input-sm" ValidationGroup="GrpGuardar"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtConsejero" FilterType="Custom, Numbers" />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtConsejero" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''No. Consejero''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRecibir"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<asp:LinkButton ID="LbAddConsejero" ValidationGroup="GrpGuardar" runat="server" CssClass="btn btn-circle btn-sm green" Text="+"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UPGv" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView runat="server" Width="60%" DataKeyNames="NumBoleta, CveConsejero" EmptyDataText="Aún no se ha registrado boleta" AutoGenerateColumns="false" GridLines="none" ID="GVDatos" CssClass="table table-striped table-advance table-hover">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="# Consejero" DataField="NumConsejero" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="70%" />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea Elminar?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
<script>
|
||||
function ActivaBoleta(Boleta) {
|
||||
if (Boleta != "") {
|
||||
$("#trConsejero").css("visibility", "visible");
|
||||
$("#C_TxtBoleta").attr('readonly', true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
111
Planeacion/Temporal/RegBoletas.aspx.vb
Normal file
111
Planeacion/Temporal/RegBoletas.aspx.vb
Normal file
@@ -0,0 +1,111 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
|
||||
|
||||
|
||||
Partial Class Temporal_RegBoletas
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "P R O P I E D A D E S "
|
||||
Public Property DTConsejeros As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTConsejeros"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTConsejeros") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property NumBoleta As Integer
|
||||
Get
|
||||
Return CType(ViewState("NumBoleta"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("NumBoleta") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property VotosBoleta As Integer
|
||||
Get
|
||||
Return CType(ViewState("VotosBoleta"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("VotosBoleta") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
VotosBoleta = 0
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LbAddConsejero_Click(sender As Object, e As EventArgs) Handles LbAddConsejero.Click
|
||||
Dim Boleta As New ClsTemporal
|
||||
DTConsejeros = New DataTable()
|
||||
Dim NumConsejero As Integer = TxtConsejero.Text.ToEntero
|
||||
Dim CveConsejero As Integer
|
||||
NumBoleta = TxtBoleta.Text.ToEntero
|
||||
|
||||
If Boleta.GetTempConsejeros Then
|
||||
DTConsejeros = Boleta.DtResultados.FiltraParametros($"NumConsejero = {NumConsejero} ")
|
||||
If DTConsejeros.Rows.Count > 0 Then
|
||||
CveConsejero = DTConsejeros.Rows(0)("CveConsejero").ToString.ToEntero
|
||||
If Boleta.AddTempVotos(CveConsejero, NumBoleta) Then
|
||||
VotosBoleta += 1
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el voto", TipoMensaje.MsgError)
|
||||
End If
|
||||
Else
|
||||
Alert("El consejero no existe, revise el número de consejero", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
TxtConsejero.Text = ""
|
||||
UpDatos.Update()
|
||||
Boleta.Dispose()
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid()
|
||||
Dim Boleta As New ClsTemporal
|
||||
If Boleta.GetTempVotos(NumBoleta) AndAlso Boleta.DtResultados.Rows.Count > 0 Then
|
||||
GVDatos.DataSource = Boleta.DtResultados
|
||||
Else
|
||||
GVDatos.DataSource = Nothing
|
||||
End If
|
||||
Boleta.Dispose()
|
||||
GVDatos.DataBind()
|
||||
UPGv.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LbAgregarBoleta_Click(sender As Object, e As EventArgs) Handles LbAgregarBoleta.Click
|
||||
If TxtBoleta.Text <> "" Then
|
||||
TxtBoleta.Enabled = False
|
||||
LbAgregarBoleta.Visible = False
|
||||
trConsejero.Visible = True
|
||||
End If
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GVDatos_DataBound(sender As Object, e As EventArgs) Handles GVDatos.DataBound
|
||||
If GVDatos.Rows.Count >= 25 Then
|
||||
Alert("Esta boleta está completa, continue con otra boleta por favor.")
|
||||
TxtBoleta.Text = ""
|
||||
TxtBoleta.Enabled = True
|
||||
LbAgregarBoleta.Visible = True
|
||||
trConsejero.Visible = False
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GVDatos.RowDeleting
|
||||
Dim Objeto As New ClsTemporal
|
||||
If Objeto.RemoveTempVotos(GVDatos.Rows(e.RowIndex).DataKey("NumBoleta").ToEntero, GVDatos.Rows(e.RowIndex).DataKey("CveConsejero").ToEntero) Then
|
||||
Alert("Se eliminó correctamente.")
|
||||
End If
|
||||
CargaGrid()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user