CRM Encuestas, Compras no actualziar iva al seleccionar no deducible
This commit is contained in:
@@ -23,6 +23,8 @@ Public Class ClsEncuestas
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Property CveEncuesta As Integer = -1
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
|
||||||
@@ -460,8 +462,10 @@ Public Class ClsEncuestas
|
|||||||
#Region " E N C U E S T A S - E S T R U C T U R A "
|
#Region " E N C U E S T A S - E S T R U C T U R A "
|
||||||
|
|
||||||
Public Function AddEncuesta(CveCampaña As Integer, CveCliente As Integer, NombreEncuesta As String, Observaciones As String, NumInvitaciones As Integer,
|
Public Function AddEncuesta(CveCampaña As Integer, CveCliente As Integer, NombreEncuesta As String, Observaciones As String, NumInvitaciones As Integer,
|
||||||
CveTipoEncuesta As Integer, SeContesto As Boolean, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
CveTipoEncuesta As Integer, SeContesto As Boolean, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoProceso As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
CveEncuesta = -1
|
||||||
DataAdapter("PA_Enc_EncuestasAdd", CommandType.StoredProcedure)
|
DataAdapter("PA_Enc_EncuestasAdd", CommandType.StoredProcedure)
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
.Add("@CveCampana", SqlDbType.Int).Value = CveCampaña
|
.Add("@CveCampana", SqlDbType.Int).Value = CveCampaña
|
||||||
@@ -474,9 +478,12 @@ Public Class ClsEncuestas
|
|||||||
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso
|
||||||
|
.Add("@CveEncuesta", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
CveEncuesta = SqlAdapter.SelectCommand.Parameters("@CveEncuesta").Value.ToString.ToEntero
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al Agregar una Encuesta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al Agregar una Encuesta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
|||||||
Binary file not shown.
@@ -312,6 +312,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
|||||||
CargaCheckLis();
|
CargaCheckLis();
|
||||||
}
|
}
|
||||||
CargarPS();
|
CargarPS();
|
||||||
|
BtnGuardarAcercamiento.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1291,7 +1292,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
|||||||
var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa, CveEncuesta = CveEncuestaProcesoCRM, CveEncuestaAplicada = CveEncuestaAplicadaProceso, CvePregunta = -1 });
|
var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa, CveEncuesta = CveEncuestaProcesoCRM, CveEncuestaAplicada = CveEncuestaAplicadaProceso, CvePregunta = -1 });
|
||||||
if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess)
|
if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess)
|
||||||
{
|
{
|
||||||
GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result;
|
GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result.ToDataTable() ;
|
||||||
if (responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0)
|
if (responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0)
|
||||||
{
|
{
|
||||||
GvDatosTecnicos.Visible = true;
|
GvDatosTecnicos.Visible = true;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTiposProcesos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVTiposProcesos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<asp:GridView ID="GVTiposProcesos" runat="server" DataKeyNames="CveTipoProceso,TipoProceso, Descripcion, NoEtapas, Estatus, CveEstatus, UsuarioIng, CveUsuarioIng, FechaIng,
|
<asp:GridView ID="GVTiposProcesos" runat="server" DataKeyNames="CveTipoProceso,TipoProceso, Descripcion, NoEtapas, Estatus, CveEstatus, UsuarioIng, CveUsuarioIng, FechaIng,
|
||||||
RequiereMedioCaptacion,RequiereImporte,RequiereProbabilidadAcercamiento,RequierePS,RequiereComision"
|
RequiereMedioCaptacion,RequiereImporte,RequiereProbabilidadAcercamiento,RequierePS,RequiereComision,CveEncuesta"
|
||||||
EmptyDataText="No se han registrado Tipos de Procesos"
|
EmptyDataText="No se han registrado Tipos de Procesos"
|
||||||
EmptyDataRowStyle-HorizontalAlign="Center" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true"
|
EmptyDataRowStyle-HorizontalAlign="Center" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true"
|
||||||
GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVTiposProcesos_RowDeleting" OnRowDataBound="GVTiposProcesos_RowDataBound">
|
GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVTiposProcesos_RowDeleting" OnRowDataBound="GVTiposProcesos_RowDataBound">
|
||||||
@@ -73,6 +73,17 @@
|
|||||||
<asp:Label ID="lblUsuarioIng" runat="server" Text='<%# Eval("UsuarioIng")%>'> </asp:Label>
|
<asp:Label ID="lblUsuarioIng" runat="server" Text='<%# Eval("UsuarioIng")%>'> </asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Encuesta" ItemStyle-Width="70px" ItemStyle-HorizontalAlign="Center">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkEncuesta" runat="server" AlternateText="Usuarios Asignados" CausesValidation="False"
|
||||||
|
Width="24.1px"
|
||||||
|
OnClick="LnkEncuesta_Click"
|
||||||
|
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-list''></i>"
|
||||||
|
/>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="Comandos">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="Comandos">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="LnkEditar" runat="server" OnClick="LnkEditar_Click" data-toggle="tooltip" CssClass="btn btn-circle btn-sm green" title="Editar" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
<asp:LinkButton ID="LnkEditar" runat="server" OnClick="LnkEditar_Click" data-toggle="tooltip" CssClass="btn btn-circle btn-sm green" title="Editar" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||||
@@ -83,6 +94,7 @@
|
|||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<div id="DivModalTipoProceso" class="modal ADS fade" role="dialog">
|
<div id="DivModalTipoProceso" class="modal ADS fade" role="dialog">
|
||||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTipoProceso" UpdateMode="Conditional">
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalTipoProceso" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -144,6 +156,189 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<%--ENCUESTA INICIO--%>
|
||||||
|
|
||||||
|
<div id="DVModalEncuesta" class="modal ADS fade" role="dialog">
|
||||||
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalEncuesta" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-content" style="width:1000px!important">
|
||||||
|
<div class="modal-header ">
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LltlModalEncuestaTitulo" Text="Encuesta" runat="server"> </asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12" style="text-align: right!important">
|
||||||
|
<asp:LinkButton runat="server" ID="LnkAgregarPregunta" OnClick="LnkAgregarPregunta_Click" Style="margin-left: 10px;" data-toggle="tooltip" title="Agregar"
|
||||||
|
class="btn btn-circle btn-sm blue"><i class="fa fa-plus"></i> Agregar Pregunta</asp:LinkButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<asp:GridView runat="server" ID="GvEstructura" DataKeyNames="Tipo,CvePregunta,CveRespuesta,Respuesta,Pregunta,RespuestaDefault,CveTema,Tema,CveTipoPregunta,TipoPregunta"
|
||||||
|
OnRowDataBound="GvEstructura_RowDataBound" GridLines="None" AutoGenerateColumns="false" CssClass="table table-advance table-hover Widthall mysmallbtn">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Tema / Tipo de Pregunta">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlTipoPregunta" Visible="True" runat="server" Text='<%# Eval("TipoPregunta")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Pregunta">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlPregunta" Visible="False" runat="server" Text='<%# Eval("Pregunta")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Respuesta Default">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlDefault" runat="server" Text=''></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Respuesta">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlRespuesta" Visible="false" runat="server" Text='<%# Eval("Respuesta")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-Width="40px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="ImgA" Visible="false" runat="server" AlternateText="Agregar" OnClick="AddEstructura" CssClass="btn blue btn-outline btn-circle btn-sm"
|
||||||
|
Text="<i class='fa fa-plus'></i> Agregar Respuesta" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-Width="40px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton Visible="false" ID="imgE" runat="server" AlternateText="Editar" OnClick="UpdateEstructura" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-Width="40px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton Visible="false" ID="imgD" runat="server" AlternateText="Eliminar" OnClick="EliminarEstructura" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar?" data-btn-ok-label="si" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<%--<asp:Button ID="Button1" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGGuardar" />--%>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DVModalPreguntas" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalPreguntas" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LtlPregunta" runat="server">Agregar Pregunta</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-md-6 form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlTipoPregunta" OnSelectedIndexChanged="DdlTipoPregunta_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me js-movimiento-programmatic" runat="server" CausesValidation="true" AppendDataBoundItems="true" Width="240px" ValidationGroup="GrpPregunta">
|
||||||
|
<asp:ListItem Value="-1" Text="Seleccione"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="1" Text="Pregunta Abierta"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="6" Text="Pregunta Abierta Multitexto"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="2" Text="Opción Múltiple"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="3" Text="Lista de Selección"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="4" Text="Si/No"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="5" Text="Entero"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="7" Text="Fecha"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVTipoPregun" runat="server" ControlToValidate="DdlTipoPregunta" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPregunta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlTipoPregunta.ClientID.ToString()%>" style="width: 240px">Tipo Pregunta:</label>
|
||||||
|
</div>
|
||||||
|
<div runat="server" id="DivChkrespuestaDefult" visible="false" class="form-group col-md-6 form-md-line-input input-iconright">
|
||||||
|
<asp:CheckBox ID="ChkRespuestaDefault" Style="padding-top: 11px;" runat="server" CssClass="form-control make-switchsd" BorderStyle="None" data-size="small"></asp:CheckBox>
|
||||||
|
<label for="ChkRespuestaDefault.ClientID.ToString()" style="">Respuesta Default: </label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtPregunta" CssClass="form-control " runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVPregunta" runat="server" ControlToValidate="TxtPregunta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPregunta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtPregunta.ClientID.ToString()%>">Pregunta:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="LbAgregarPregunta" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpPregunta" OnClick="LbAgregarPregunta_Click" />
|
||||||
|
<button id="LbCancelarPregunta" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="ModalRespuestas" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog" style="width: 450px;">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRespuestas" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LtlRespuesta" runat="server">Agregar Respuesta</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<%-- <div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlPregunta" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Enabled="true" AppendDataBoundItems="true" DataTextField="Pregunta" DataValueField="CvePregunta" Width="240px" CausesValidation="true" ValidationGroup="GrpRespuesta"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVPreguntaResp" runat="server" ControlToValidate="DdlPregunta" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRespuesta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= DdlPregunta.ClientID.ToString()%>" style="width: 240px">Pregunta:</label>
|
||||||
|
</div>--%>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtRespuesta" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVRespuesta" runat="server" ControlToValidate="TxtRespuesta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Respuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRespuesta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtRespuesta.ClientID.ToString()%>">Respuesta:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:CheckBox runat="server" ID="ChkSeguirRespondiendo" Text="Seguir Respondiendo" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="LbAgregarRespuesta" OnClick="LbAgregarRespuesta_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpRespuesta" />
|
||||||
|
<button id="LbCancelarRespuesta" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<%--ENCUESTA FIN --%>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ using System.Web.UI.WebControls;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using Microsoft.Reporting.WebForms;
|
using Microsoft.Reporting.WebForms;
|
||||||
using Extensiones;
|
using Extensiones;
|
||||||
|
using System.ComponentModel.Design;
|
||||||
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using Profact.TimbraCFDI33.Complementos.CartaPorte10;
|
||||||
|
|
||||||
public partial class CRM_CatTipoProceso : ClsPaginas
|
public partial class CRM_CatTipoProceso : ClsPaginas
|
||||||
{
|
{
|
||||||
@@ -47,6 +50,108 @@ public partial class CRM_CatTipoProceso : ClsPaginas
|
|||||||
ViewState["CveTipoProceso"] = value;
|
ViewState["CveTipoProceso"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int CvePregunta{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["CvePregunta"] == null)
|
||||||
|
{
|
||||||
|
ViewState["CvePregunta"] = -1;
|
||||||
|
}
|
||||||
|
return ViewState["CvePregunta"].ToString().ToEntero();
|
||||||
|
}
|
||||||
|
set{
|
||||||
|
ViewState["CvePregunta"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//private int CveCampana
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// if(ViewState["CveCampana"] == null)
|
||||||
|
// {
|
||||||
|
// ViewState["CveCampana"] = -1;
|
||||||
|
// }
|
||||||
|
// return ViewState["CveCampana"].ToString().ToEntero();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// ViewState["CveCampana"] = value;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//private int CveTipoEncuesta
|
||||||
|
//{
|
||||||
|
// get
|
||||||
|
// {
|
||||||
|
// if (ViewState["CveTipoEncuesta"] == null)
|
||||||
|
// {
|
||||||
|
// ViewState["CveTipoEncuesta"] = -1;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return ViewState["CveTipoEncuesta"].ToString().ToEntero();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// ViewState["CveTipoEncuesta"] = value;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
private int CveEncuesta
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["CveEncuesta"] == null)
|
||||||
|
{
|
||||||
|
ViewState["CveEncuesta"] = -1;
|
||||||
|
}
|
||||||
|
return ViewState["CveEncuesta"].ToString().ToEntero();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["CveEncuesta"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int CveTema
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["CveTema"] == null)
|
||||||
|
{
|
||||||
|
ViewState["CveTema"] = -1;
|
||||||
|
}
|
||||||
|
return ViewState["CveTema"].ToString().ToEntero();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["CveTema"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int CveRespuesta
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["CveRespuesta"] == null)
|
||||||
|
{
|
||||||
|
ViewState["CveRespuesta"] = -1;
|
||||||
|
}
|
||||||
|
return ViewState["CveRespuesta"].ToString().ToEntero();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["CveRespuesta"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -227,4 +332,537 @@ public partial class CRM_CatTipoProceso : ClsPaginas
|
|||||||
|
|
||||||
ImprimirPDF("Empresas/Grales/Formatos/RepCatTipoProceso.rdlc", TmpDT, param, "Report Cat Tipo Proceso", formato, RDSName: "DataSet1");
|
ImprimirPDF("Empresas/Grales/Formatos/RepCatTipoProceso.rdlc", TmpDT, param, "Report Cat Tipo Proceso", formato, RDSName: "DataSet1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region "ENCUESTAS"
|
||||||
|
|
||||||
|
private bool ValidaEncuesta(int CveTipoProcesoEnc, string TipoProcesEnc)
|
||||||
|
{
|
||||||
|
//CveCampana = -1;
|
||||||
|
//CveTipoEncuesta = -1;
|
||||||
|
|
||||||
|
//CveEncuesta = -1;
|
||||||
|
|
||||||
|
bool respuesta = false;
|
||||||
|
bool ActualizarDatos = false;
|
||||||
|
|
||||||
|
ClsEncuestas objEcuesta = new ClsEncuestas();
|
||||||
|
objEcuesta.IniciaTransacSQL();
|
||||||
|
|
||||||
|
int CveCampanaVal = 0;
|
||||||
|
int CveTipoEncuestaVal = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if ( objEcuesta.GetCampañas(-1, -1, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveCampanaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveCampana", $" Campana = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
|
||||||
|
if(!(CveCampanaVal > 0))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (objEcuesta.AddCampañas("CRM Tipos de Procesos", "CRM Tipos de Procesos", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
if (objEcuesta.GetCampañas(-1, -1, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveCampanaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveCampana", $" Campana = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(CveCampanaVal > 0)
|
||||||
|
{
|
||||||
|
if (objEcuesta.GetTiposEncuestas(-1, -1, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveTipoEncuestaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveTipoEncuesta", $" TipoEncuesta = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
|
||||||
|
if (!(CveTipoEncuestaVal > 0))
|
||||||
|
{
|
||||||
|
if (objEcuesta.AddTiposEncuestas("CRM Tipos de Procesos", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,6))
|
||||||
|
{
|
||||||
|
if (objEcuesta.GetTiposEncuestas(-1, -1, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveTipoEncuestaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveTipoEncuesta", $" TipoEncuesta = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
|
||||||
|
if (!(CveTipoEncuestaVal > 0))
|
||||||
|
{
|
||||||
|
Alert("No se pudo obtener el Tipo de encuesta", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert("No se pudo obtener la campaña", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(CveCampanaVal > 0 && CveTipoEncuestaVal > 0 && CveTema > 0 && CveEncuesta <= 0)
|
||||||
|
{
|
||||||
|
if(objEcuesta.AddEncuesta(CveCampanaVal, -1,$"CRM {TipoProcesEnc}", $"CRM {TipoProcesEnc}",0, CveTipoEncuestaVal, false, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProceso: CveTipoProcesoEnc))
|
||||||
|
{
|
||||||
|
CveEncuesta = objEcuesta.CveEncuesta;
|
||||||
|
respuesta = true;
|
||||||
|
ActualizarDatos = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (respuesta)
|
||||||
|
{
|
||||||
|
objEcuesta.Commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objEcuesta.RollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
objEcuesta.Dispose();
|
||||||
|
|
||||||
|
|
||||||
|
if (ActualizarDatos)
|
||||||
|
{
|
||||||
|
CargaDatos();
|
||||||
|
}
|
||||||
|
|
||||||
|
return respuesta;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ValidaEncuestaTemaPreguntas()
|
||||||
|
{
|
||||||
|
|
||||||
|
CveTema = -1;
|
||||||
|
|
||||||
|
bool respuesta = false;
|
||||||
|
|
||||||
|
ClsEncuestas objEcuesta = new ClsEncuestas();
|
||||||
|
objEcuesta.IniciaTransacSQL();
|
||||||
|
|
||||||
|
int CveTemaVal = 0;
|
||||||
|
|
||||||
|
if (objEcuesta.GetTemasEncuestas(-1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveTemaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveTema", $" Tema = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
|
||||||
|
if (CveTemaVal > 0)
|
||||||
|
{
|
||||||
|
CveTema = CveTemaVal;
|
||||||
|
respuesta = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (objEcuesta.AddTemasEncuestas("CRM Tipos de Procesos", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
if (objEcuesta.GetTemasEncuestas(-1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
CveTemaVal = ModExtensiones.FiltroPrimeroValor(objEcuesta.DtResultados, "CveTema", $" Tema = 'CRM Tipos de Procesos'").ToEntero();
|
||||||
|
CveTema = CveTemaVal;
|
||||||
|
|
||||||
|
if (CveTema > 0)
|
||||||
|
{
|
||||||
|
respuesta = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert("No se pudo obtener el tema de las preguntas", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (respuesta)
|
||||||
|
{
|
||||||
|
objEcuesta.Commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
objEcuesta.RollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
objEcuesta.Dispose();
|
||||||
|
|
||||||
|
|
||||||
|
return respuesta;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void LnkEncuesta_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
|
||||||
|
int CveTipoProcesoEnc = GvRow.DataKey("CveTipoProceso").ToEntero();
|
||||||
|
string TipoProcesEnc = GvRow.DataKey("TipoProceso");
|
||||||
|
CveEncuesta = GvRow.DataKey("CveEncuesta").ToEntero();
|
||||||
|
//Literal LltlModalEncuestaTitulo = GvRow.FCLiteral("LltlModalEncuestaTitulo");
|
||||||
|
|
||||||
|
|
||||||
|
if (!(CveEncuesta > 0))
|
||||||
|
{
|
||||||
|
if (!ValidaEncuesta(CveTipoProcesoEnc, TipoProcesEnc) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ValidaEncuestaTemaPreguntas())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LltlModalEncuestaTitulo.Text = $"Encuesta {TipoProcesEnc}";
|
||||||
|
UpModalEncuesta.Update();
|
||||||
|
CargaEstructura(CveEncuesta);
|
||||||
|
RegistraScript("$('#DVModalEncuesta').modal('show');");
|
||||||
|
|
||||||
|
// Alert($"CveEncuesta: {CveEncuesta} <br> CveTema:{CveTema}");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
protected void LnkAgregarPregunta_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CvePregunta = -1;
|
||||||
|
LimpiaControlesModalEncuesta();
|
||||||
|
|
||||||
|
RegistraScript("$('#DVModalPreguntas').modal('show');");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LimpiaControlesModalEncuesta()
|
||||||
|
{
|
||||||
|
TxtPregunta.Text = " ";
|
||||||
|
DdlTipoPregunta.SelectedIndex = 0;
|
||||||
|
DivChkrespuestaDefult.Visible = false;
|
||||||
|
ChkRespuestaDefault.Checked = true;
|
||||||
|
UpModalPreguntas.Update();
|
||||||
|
}
|
||||||
|
protected void DdlTipoPregunta_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// REVISAR PORQUE NO ENTRA BIEN AQUI, DIV MAL CERRADO???
|
||||||
|
if (DdlTipoPregunta.SelectedValue == "4")
|
||||||
|
DivChkrespuestaDefult.Visible = true;
|
||||||
|
else
|
||||||
|
DivChkrespuestaDefult.Visible = false;
|
||||||
|
UpModalPreguntas.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void LbAgregarPregunta_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
bool errorProceso = true;
|
||||||
|
|
||||||
|
int RespuestaDefault = -1;
|
||||||
|
if (DdlTipoPregunta.SelectedValue.ToEntero() == 4)
|
||||||
|
{
|
||||||
|
RespuestaDefault = ChkRespuestaDefault.Checked ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CvePregunta> 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Objeto.UpdatePreguntas(CvePregunta, TxtPregunta.Text, DdlTipoPregunta.SelectedValue.ToEntero(), CveTema, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RespuestaDefault))
|
||||||
|
{
|
||||||
|
Alert("La Pregunta se actualizó correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
errorProceso = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Objeto.AddPreguntas(TxtPregunta.Text, CveEncuesta, DdlTipoPregunta.SelectedValue.ToEntero(), CveTema, UsuarioActual.CveUsuario, RespuestaDefault))
|
||||||
|
{
|
||||||
|
Alert("La Pregunta se agregó correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
errorProceso = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Objeto.Dispose();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!errorProceso)
|
||||||
|
{
|
||||||
|
CargaEstructura(CveEncuesta);
|
||||||
|
RegistraScript("$('#DVModalPreguntas').modal('hide');");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaEstructura(int tCveEncuesta)
|
||||||
|
{
|
||||||
|
ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
|
||||||
|
if (Objeto.GetEstructura(tCveEncuesta, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
GvEstructura.DataSource = Objeto.DtResultados;
|
||||||
|
}
|
||||||
|
|
||||||
|
Objeto.Dispose();
|
||||||
|
|
||||||
|
GvEstructura.DataBind();
|
||||||
|
UpModalEncuesta.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void GvEstructura_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||||
|
{
|
||||||
|
var Tipo = e.Row.DataKey("Tipo").ToString();
|
||||||
|
|
||||||
|
switch (Tipo)
|
||||||
|
{
|
||||||
|
case "1":
|
||||||
|
{
|
||||||
|
e.Row.Font.Bold = true;
|
||||||
|
e.Row.ForeColor = System.Drawing.Color.White;
|
||||||
|
e.Row.BackColor = System.Drawing.Color.FromArgb(1, 186, 205, 206);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "2":
|
||||||
|
{
|
||||||
|
e.Row.BackColor = System.Drawing.Color.FromArgb(1, 213, 225, 225);
|
||||||
|
e.Row.FCLiteral("LtlPregunta").Visible = true;
|
||||||
|
e.Row.FCLinkButton("ImgA").Visible = true;
|
||||||
|
|
||||||
|
e.Row.FCLinkButton("imgE").Visible = true;
|
||||||
|
e.Row.FCLinkButton("imgD").Visible = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "3":
|
||||||
|
{
|
||||||
|
e.Row.BackColor = System.Drawing.Color.White;
|
||||||
|
e.Row.FCLiteral("LtlRespuesta").Visible = true;
|
||||||
|
e.Row.FCLinkButton("imgE").Visible = true;
|
||||||
|
e.Row.FCLinkButton("imgD").Visible = true;
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(e.Row.DataKey("CvePregunta").ToEntero() > 0))
|
||||||
|
e.Row.FCLiteral("LtlTipoPregunta").Text = e.Row.DataKey("Tema");
|
||||||
|
|
||||||
|
if (e.Row.DataKey("RespuestaDefault").ToString() == "0")
|
||||||
|
e.Row.FCLiteral("LtlDefault").Text = "No";
|
||||||
|
else if (e.Row.DataKey("RespuestaDefault").ToString() == "1")
|
||||||
|
e.Row.FCLiteral("LtlDefault").Text = "Si";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void AddEstructura(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
int Tipo = GvRow.DataKey("Tipo").ToString().ToEntero();
|
||||||
|
|
||||||
|
if (Tipo == 2)
|
||||||
|
{
|
||||||
|
LtlRespuesta.Text = "Agregar Respuesta";
|
||||||
|
LbAgregarRespuesta.Text = "Guardar";
|
||||||
|
CveRespuesta = -1;
|
||||||
|
CvePregunta = GvRow.DataKey("CvePregunta").ToEntero();
|
||||||
|
TxtRespuesta.Text = "";
|
||||||
|
UpModalRespuestas.Update();
|
||||||
|
|
||||||
|
RegistraScript(string.Format("$('#{0}').modal();", "ModalRespuestas"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void EliminarEstructura(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
int Tipo = GvRow.DataKey("Tipo").ToString().ToEntero();
|
||||||
|
switch (Tipo)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
// RESPUESTA
|
||||||
|
EliminarRespuesta(GvRow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
// PREGUNTAS
|
||||||
|
EliminarPregunta(GvRow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void UpdateEstructura(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
int Tipo = GvRow.DataKey("Tipo").ToString().ToEntero();
|
||||||
|
switch (Tipo)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
ActualizaRespuestas(GvRow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
ActualizaPregunta(GvRow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ActualizaPregunta(GridViewRow GvRow)
|
||||||
|
{
|
||||||
|
|
||||||
|
LtlPregunta.Text = "Editar Pregunta";
|
||||||
|
LbAgregarPregunta.Text = "Actualizar";
|
||||||
|
CvePregunta = GvRow.DataKey("CvePregunta").ToEntero();
|
||||||
|
TxtPregunta.Text = GvRow.DataKey("Pregunta");
|
||||||
|
DdlTipoPregunta.SelectedValueExist(GvRow.DataKey("CveTipoPregunta"));
|
||||||
|
|
||||||
|
if (DdlTipoPregunta.SelectedValue == "4")
|
||||||
|
{
|
||||||
|
DivChkrespuestaDefult.Visible = true;
|
||||||
|
|
||||||
|
if (GvRow.DataKey("RespuestaDefault").ToEntero() == 1)
|
||||||
|
ChkRespuestaDefault.Checked = true;
|
||||||
|
else
|
||||||
|
ChkRespuestaDefault.Checked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DivChkrespuestaDefult.Visible = false;
|
||||||
|
|
||||||
|
UpModalPreguntas.Update();
|
||||||
|
RegistraScript(string.Format("$('#{0}').modal();", "DVModalPreguntas"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void EliminarPregunta(GridViewRow GvRow)
|
||||||
|
{
|
||||||
|
ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
if (Objeto.RemovePreguntas(GvRow.DataKey("CvePregunta").ToEntero()))
|
||||||
|
{
|
||||||
|
Alert("La Pregunta se eliminó correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
}
|
||||||
|
|
||||||
|
Objeto.Dispose();
|
||||||
|
CargaEstructura(CveEncuesta);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region "RESPUESTAS"
|
||||||
|
|
||||||
|
|
||||||
|
//private void CargaPreguntasEnModal()
|
||||||
|
//{
|
||||||
|
// ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
// if (Objeto.GetPreguntas(DdlFiltroEncuestas.SelectedValue.ToEntero, -1, -1, -1, UsuarioActual.CveEmpresa))
|
||||||
|
// {
|
||||||
|
// DdlPregunta.DataSource = Objeto.DtResultados;
|
||||||
|
// DdlPregunta.Items.Clear();
|
||||||
|
// DdlPregunta.Items.Insert(0, new ListItem("Seleccione (Todos)", "-1"));
|
||||||
|
// DdlPregunta.DataBind();
|
||||||
|
// UpModalRespuestas.Update();
|
||||||
|
// }
|
||||||
|
// Objeto.Dispose();
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
//private void AgregaRespuestas(GridViewRow GvRow)
|
||||||
|
//{
|
||||||
|
|
||||||
|
// LtlRespuesta.Text = "Agregar Respuesta";
|
||||||
|
// LbAgregarRespuesta.Text = "Guardar";
|
||||||
|
|
||||||
|
// CveRespuesta = -1;
|
||||||
|
// //CargaPreguntasEnModal();
|
||||||
|
// DdlPregunta.SelectedValue = GvRow.DataKey("CvePregunta");
|
||||||
|
// TxtRespuesta.Text = "";
|
||||||
|
// //UpHdn.Update();
|
||||||
|
// UpModalRespuestas.Update();
|
||||||
|
|
||||||
|
// RegistraScript(string.Format("$('#{0}').modal();", "ModalRespuestas"));
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
private void ActualizaRespuestas(GridViewRow GvRow)
|
||||||
|
{
|
||||||
|
|
||||||
|
LtlRespuesta.Text = "Editar Respuesta";
|
||||||
|
LbAgregarRespuesta.Text = "Actualizar";
|
||||||
|
CveRespuesta = GvRow.DataKey("CveRespuesta").ToEntero();
|
||||||
|
CvePregunta = GvRow.DataKey("CvePregunta").ToEntero();
|
||||||
|
TxtRespuesta.Text = GvRow.DataKey("Respuesta");
|
||||||
|
UpModalRespuestas.Update();
|
||||||
|
RegistraScript(string.Format("$('#{0}').modal();", "ModalRespuestas"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void LbAgregarRespuesta_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bool errorProceso = true;
|
||||||
|
ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
if (!(CveRespuesta > 0))
|
||||||
|
{
|
||||||
|
if (Objeto.AddRespuestas(TxtRespuesta.Text, CvePregunta))
|
||||||
|
{
|
||||||
|
Alert("La Respuesta se registró correctamente..", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
errorProceso = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Objeto.UpdateRespuestas(CveRespuesta, TxtRespuesta.Text, CvePregunta))
|
||||||
|
{
|
||||||
|
Alert("La Respuesta se actualizó correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
errorProceso = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Objeto.Dispose();
|
||||||
|
|
||||||
|
if (!errorProceso)
|
||||||
|
{
|
||||||
|
if (ChkSeguirRespondiendo.Checked)
|
||||||
|
{
|
||||||
|
TxtRespuesta.Text = "";
|
||||||
|
UpModalRespuestas.Update();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegistraScript("$('#ModalRespuestas').modal('hide');;");
|
||||||
|
}
|
||||||
|
|
||||||
|
CargaEstructura(CveEncuesta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void EliminarRespuesta(GridViewRow GvRow)
|
||||||
|
{
|
||||||
|
ClsEncuestas Objeto = new ClsEncuestas();
|
||||||
|
if (Objeto.RemoveRespuesta(GvRow.DataKey("CveRespuesta").ToEntero()))
|
||||||
|
{
|
||||||
|
Alert("La respuesta se eliminó correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||||
|
CargaEstructura(CveEncuesta);
|
||||||
|
}
|
||||||
|
Objeto.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17603,6 +17603,11 @@ Partial Class Compras_Compras
|
|||||||
Dim Total = (Cantidad * PU) - Descuento + OtrosGastos
|
Dim Total = (Cantidad * PU) - Descuento + OtrosGastos
|
||||||
DrPS("NoDeducible") = ChkEsNoDeduciblePS.Checked
|
DrPS("NoDeducible") = ChkEsNoDeduciblePS.Checked
|
||||||
|
|
||||||
|
Dim ActualizarIva As Boolean = False
|
||||||
|
If Cantidad.RoundSQL(2) <> TxtCantidad.Text.Trim.ToDouble.RoundSQL(2) Or PU.RoundSQL(2) <> TxtPrecio.Text.Trim.ToDouble.RoundSQL(2) Then
|
||||||
|
ActualizarIva = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Cantidad <> TxtCantidad.Text.Trim.ToDouble OrElse PU <> TxtPrecio.Text.Trim.ToDouble OrElse Descuento <> TxtDescuentoModal.Text.ToDouble OrElse OtrosGastos <> TxtOtrosGastos.Text.ToDouble Then
|
If Cantidad <> TxtCantidad.Text.Trim.ToDouble OrElse PU <> TxtPrecio.Text.Trim.ToDouble OrElse Descuento <> TxtDescuentoModal.Text.ToDouble OrElse OtrosGastos <> TxtOtrosGastos.Text.ToDouble Then
|
||||||
Cantidad = TxtCantidad.Text.Trim.ToDouble
|
Cantidad = TxtCantidad.Text.Trim.ToDouble
|
||||||
@@ -17616,8 +17621,12 @@ Partial Class Compras_Compras
|
|||||||
DrPS("OtrosGastos") = OtrosGastos
|
DrPS("OtrosGastos") = OtrosGastos
|
||||||
DrPS("Total") = Total
|
DrPS("Total") = Total
|
||||||
AplicaCalculaTotales = True
|
AplicaCalculaTotales = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'PS - CLASIFICACION
|
'PS - CLASIFICACION
|
||||||
If DdlPS.SelectedValue.ToEntero > 0 Then
|
If DdlPS.SelectedValue.ToEntero > 0 Then
|
||||||
|
|
||||||
@@ -17676,7 +17685,11 @@ Partial Class Compras_Compras
|
|||||||
DrPS("IVA") = 0
|
DrPS("IVA") = 0
|
||||||
DrPS("IVAPorcentaje") = 0
|
DrPS("IVAPorcentaje") = 0
|
||||||
Else
|
Else
|
||||||
DrPS("IVA") = (IVA * Total).RoundSQL
|
|
||||||
|
If ActualizarIva Then
|
||||||
|
DrPS("IVA") = (IVA * Total).RoundSQL
|
||||||
|
End If
|
||||||
|
|
||||||
DrPS("IVAPorcentaje") = IVA
|
DrPS("IVAPorcentaje") = IVA
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user