CRM Encuestas, Compras no actualziar iva al seleccionar no deducible
This commit is contained in:
@@ -7,6 +7,9 @@ using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
using Extensiones;
|
||||
using System.ComponentModel.Design;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using Profact.TimbraCFDI33.Complementos.CartaPorte10;
|
||||
|
||||
public partial class CRM_CatTipoProceso : ClsPaginas
|
||||
{
|
||||
@@ -47,6 +50,108 @@ public partial class CRM_CatTipoProceso : ClsPaginas
|
||||
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
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user