This commit is contained in:
@@ -7,26 +7,81 @@ using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
public partial class OI_UnoaUno : ClsPaginas
|
||||
{
|
||||
|
||||
|
||||
#region Propiedades
|
||||
public const string idDivModalSeguir = "idDivModalSeguir";
|
||||
public const string idDivModalSiguiendoA = "idDivModalSiguiendoA";
|
||||
private int CcveUnoaUnoPregunta
|
||||
{
|
||||
get { return (ViewState["CcveUnoaUnoPregunta"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoPregunta"]); }
|
||||
set { ViewState["CcveUnoaUnoPregunta"] = value; }
|
||||
}
|
||||
private System.Data.DataTable DtPreguntas
|
||||
{
|
||||
get { return (ViewState["DtPreguntas"] == null) ? null : (System.Data.DataTable)ViewState["DtPreguntas"]; }
|
||||
set { ViewState["DtPreguntas"] = value; }
|
||||
}
|
||||
//private int CcveUnoaUnoCuestionario
|
||||
//{
|
||||
// get { return (ViewState["CcveUnoaUnoCuestionario"] == null) ? 0 : Convert.ToInt32(ViewState["CcveUnoaUnoCuestionario"]); }
|
||||
// set { ViewState["CcveUnoaUnoCuestionario"] = value; }
|
||||
//}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
TxtCFecha.Text = DateTime.Now.ToString("dd/MM/yyyy");
|
||||
LtlusuarioTitulo.Text = UsuarioActual.Nombre;
|
||||
|
||||
|
||||
|
||||
GvUsuarioCuest.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC");
|
||||
GvUsuarioCuest.DataBind();
|
||||
CargarSiguiendoA();
|
||||
CargarSeguidoPor();
|
||||
BtnConsultar_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarSiguiendoA()
|
||||
{
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoAUnoSiguiendoA(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa);
|
||||
GVSiguiendoA.DataSource = ObjUnoa.DtResultados;//.FiltraParametros("","",new string[] { "CveSeguir", "Usuario" });
|
||||
}
|
||||
GVSiguiendoA.DataBind();
|
||||
}
|
||||
private void CargarSeguidoPor()
|
||||
{
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoaUnoCuestionario_Usuarios(-1, -1, UsuarioActual.CveUsuario);
|
||||
GVSeguidoPor.DataSource = ObjUnoa.DtResultados.FiltraParametros("", "", new string[] { "CveUsuarioSeguidor", "NombreSeguidor" });
|
||||
}
|
||||
GVSeguidoPor.DataBind();
|
||||
}
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GVPA_OI_UnoAUnoTableroGet.DataSource = new System.Data.DataTable();
|
||||
using (ClsOIEventos ObjPA_O = new ClsOIEventos())
|
||||
{
|
||||
|
||||
ObjPA_O.UnoAUnoTableroGet(UsuarioActual.CveEmpresa, TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario);
|
||||
GVPA_OI_UnoAUnoTableroGet.DataSource = ObjPA_O.DtResultados;
|
||||
ObjPA_O.Dispose();
|
||||
GVPA_OI_UnoAUnoTableroGet.DataBind();
|
||||
}
|
||||
GVPA_OI_UnoAUnoTableroGet.DataBind();
|
||||
if (GVPA_OI_UnoAUnoTableroGet.Rows.Count > 0)
|
||||
{
|
||||
LnkGuardar.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LnkGuardar.Visible = false;
|
||||
}
|
||||
UpContenido.Update();
|
||||
}
|
||||
|
||||
protected void LnkGuardar_Click(object sender, EventArgs e)
|
||||
@@ -39,11 +94,11 @@ public partial class OI_UnoaUno : ClsPaginas
|
||||
{
|
||||
if (continuar)
|
||||
{
|
||||
int CveUnoaUnoEtiqueta = gvrow.DataKey("CveUnoaUnoEtiqueta").ToEntero();
|
||||
if (CveUnoaUnoEtiqueta > 0)
|
||||
int CveUnoaUnoPregunta = gvrow.DataKey("CveUnoaUnoPregunta").ToEntero();
|
||||
if (CveUnoaUnoPregunta > 0)
|
||||
{
|
||||
string Comentarios = gvrow.FCTextBox("TxtComentarios").Text;
|
||||
continuar = ObjPA_O.UnoAUnoTableroAdd(UsuarioActual.CveEmpresa, fecha, UsuarioActual.CveUsuario, CveUnoaUnoEtiqueta, Comentarios);
|
||||
continuar = ObjPA_O.UnoAUnoTableroAdd(UsuarioActual.CveEmpresa, fecha, UsuarioActual.CveUsuario, CveUnoaUnoPregunta, Comentarios);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +107,470 @@ public partial class OI_UnoaUno : ClsPaginas
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
Alert("Información Actualizada");
|
||||
Alert("Tus respuestas se han actualizado", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkSeguir_Click(object sender, EventArgs e)
|
||||
{
|
||||
TabContainerSeguir.ActiveTabIndex = 0;
|
||||
CargarPreguntas();
|
||||
cargarCuestionario(); CargarSeguirA();
|
||||
if (GVUnoaUnoPregunta.Rows.Count > 0)
|
||||
{
|
||||
TabContainerSeguir.ActiveTabIndex = 1;
|
||||
//if (GVCuestionario.Rows.Count > 0)
|
||||
//{
|
||||
// TabContainerSeguir.ActiveTabIndex = 2;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
TabContainerSeguir.ActiveTabIndex = 0;
|
||||
}
|
||||
switch (TabContainerSeguir.ActiveTabIndex)
|
||||
{
|
||||
case 1:
|
||||
TxtCuestionario.Focus();
|
||||
break;
|
||||
case 2:
|
||||
//TxtCuestionario.Focus();
|
||||
break;
|
||||
default:
|
||||
TxtPregunta.Focus();
|
||||
break;
|
||||
}
|
||||
RegistraScript(string.Format("$('#{0}').modal()", idDivModalSeguir));
|
||||
UpModalSeguir.Update();
|
||||
openmodalseguir();
|
||||
}
|
||||
private void openmodalseguir()
|
||||
{
|
||||
string focustxt = "$('.TxtPregunta').focus();";
|
||||
switch (TabContainerSeguir.ActiveTabIndex)
|
||||
{
|
||||
case 1:
|
||||
focustxt = "$('.TxtCuestionario').focus();";
|
||||
break;
|
||||
default:
|
||||
focustxt = "$('.TxtPregunta').focus();";
|
||||
break;
|
||||
}
|
||||
RegistraScript(string.Format("$('#{0}').modal();$('#{0}').on('shown.bs.modal', function (e) {{ {1} }});", idDivModalSeguir, focustxt));
|
||||
}
|
||||
#region pregunta
|
||||
private void CargarPreguntas()
|
||||
{
|
||||
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
if (ObjUnoa.GetUnoaUnoPregunta(-1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GVUnoaUnoPregunta.DataSource = ObjUnoa.DtResultados;
|
||||
DdlPregunta.DataSource = ObjUnoa.DtResultados;
|
||||
GvPreguntasCuestionario.DataSource = ObjUnoa.DtResultados;
|
||||
|
||||
}
|
||||
}
|
||||
GvPreguntasCuestionario.DataBind();
|
||||
GVUnoaUnoPregunta.DataBind();
|
||||
DdlPregunta.DataBind();
|
||||
//DdlPregunta.Items.Insert(0, new ListItem("", "-2"));
|
||||
DdlPregunta.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
upPreguntas.Update();
|
||||
}
|
||||
|
||||
//protected void LnkAgregarPregunta_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// TxtPregunta.Text = "";
|
||||
// DdlPregunta.SelectedIndex = -1;
|
||||
// CcveUnoaUnoPregunta = -1;
|
||||
// LtlTituloPregunta.Text = "Agregar Pregunta";
|
||||
// TxtPregunta.Focus();
|
||||
|
||||
// LnkAgregarPregunta.Visible = false;
|
||||
// LnkGuardarPregunta.Visible = true;
|
||||
// LnkCancelarPregunta.Visible = true;
|
||||
//}
|
||||
protected void LnkEditarPregunta_Click(object sender, EventArgs e)
|
||||
{
|
||||
TxtPregunta.Text = "";
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
TxtPregunta.Focus();
|
||||
|
||||
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CcveUnoaUnoPregunta = gvRow.DataKey("CveUnoaUnoPregunta").ToEntero();
|
||||
string Pregunta = gvRow.DataKey("Pregunta");
|
||||
int cveUnoaUnoPreguntaVinculo = gvRow.DataKey("CveUnoaUnoPreguntaVinculo").ToEntero();
|
||||
|
||||
TxtPregunta.Text = Pregunta;
|
||||
DdlPregunta.SelectedValue = "-1";
|
||||
DdlPregunta.SelectedValueExist(cveUnoaUnoPreguntaVinculo.ToString());
|
||||
|
||||
|
||||
LnkGuardarPregunta.Text = "Actualizar";
|
||||
LnkCancelarPregunta.Visible = true;
|
||||
upPreguntas.Update();
|
||||
openmodalseguir();
|
||||
}
|
||||
protected void LnkCancelarPregunta_Click(object sender, EventArgs e)
|
||||
{
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
LnkGuardarPregunta.Text = "Guardar";
|
||||
LnkCancelarPregunta.Visible = false;
|
||||
upPreguntas.Update();
|
||||
openmodalseguir();
|
||||
}
|
||||
protected void LnkEliminarPregunta_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CcveUnoaUnoPregunta = gvRow.DataKey("CveUnoaUnoPregunta").ToEntero();
|
||||
bool continuar = true;
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
|
||||
continuar = ObjUnoa.RemoveUnoaUnoPregunta(CcveUnoaUnoPregunta, UsuarioActual.CveEmpresa);
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
TxtPregunta.Text = "";
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
TxtPregunta.Focus();
|
||||
LnkGuardarPregunta.Text = "Guardar";
|
||||
LnkCancelarPregunta.Visible = false;
|
||||
Alert("La pregunta se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
CargarPreguntas();
|
||||
}
|
||||
openmodalseguir();
|
||||
}
|
||||
|
||||
protected void LnkGuardarPregunta_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool continuar = true;
|
||||
|
||||
string Pregunta = TxtPregunta.Text;
|
||||
int cveUnoaUnoPreguntaVinculo = DdlPregunta.SelectedValue.ToEntero();
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
if (CcveUnoaUnoPregunta > 0)
|
||||
{
|
||||
|
||||
continuar = ObjUnoa.UpUnoaUnoPregunta(CcveUnoaUnoPregunta, Pregunta, cveUnoaUnoPreguntaVinculo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = ObjUnoa.AddUnoaUnoPregunta(Pregunta, cveUnoaUnoPreguntaVinculo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
CargarPreguntas();
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
TxtPregunta.Text = "";
|
||||
CcveUnoaUnoPregunta = -1;
|
||||
TxtPregunta.Focus();
|
||||
LnkGuardarPregunta.Text = "Guardar";
|
||||
LnkCancelarPregunta.Visible = false;
|
||||
Alert("La pregunta se ha agregado correctamente", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
}
|
||||
openmodalseguir();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Cuestionario
|
||||
private void cargarCuestionario()
|
||||
{
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoaUnoCuestionario(-1, UsuarioActual.CveUsuario);
|
||||
DtPreguntas = ObjUnoa.DtResultados;
|
||||
DdlCuestionario.DataSource = ObjUnoa.DtResultados;
|
||||
}
|
||||
//GVCuestionario.DataBind();
|
||||
DdlCuestionario.DataBind();
|
||||
DdlCuestionario.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
openmodalseguir();
|
||||
}
|
||||
protected void LnkGuardarCuestionario_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
bool continuar = true;
|
||||
|
||||
string Cuestionario = TxtCuestionario.Text;
|
||||
string Comentario = TxtCuestComentario.Text;
|
||||
int cveUnoaUnoPreguntaVinculo = DdlPregunta.SelectedValue.ToEntero();
|
||||
int CveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero();
|
||||
string msg = "";
|
||||
List<int> lPreguntas = new List<int>();
|
||||
foreach (GridViewRow item in GvPreguntasCuestionario.Rows)
|
||||
{
|
||||
CheckBox chk = item.FCCheckBox("ChkConPregunta");
|
||||
if (chk.Checked)
|
||||
{
|
||||
lPreguntas.Add(item.DataKey("CveUnoaUnoPregunta").ToEntero());
|
||||
}
|
||||
}
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
if (CveUnoaUnoCuestionario > 0)
|
||||
{
|
||||
|
||||
continuar = ObjUnoa.UpUnoaUnoCuestionario(CveUnoaUnoCuestionario, Cuestionario, Comentario, UsuarioActual.CveUsuario, lPreguntas);
|
||||
msg = "El cuestionario se ha actualizado correctamente";
|
||||
}
|
||||
else
|
||||
{
|
||||
continuar = ObjUnoa.AddUnoaUnoCuestionario(Cuestionario, Comentario, UsuarioActual.CveUsuario, lPreguntas);
|
||||
msg = "El cuestionario se ha agregado correctamente";
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
DdlCuestionario.SelectedIndex = -1;
|
||||
cargarCuestionario();
|
||||
DdlCuestionario_SelectedIndexChanged(null, null);
|
||||
Alert(msg, ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
}
|
||||
openmodalseguir();
|
||||
}
|
||||
|
||||
|
||||
protected void DdlCuestionario_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
int CveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero();
|
||||
string Cuestionario = DdlCuestionario.SelectedItem.Text;
|
||||
string Comentario = "";
|
||||
if (CveUnoaUnoCuestionario > 0)
|
||||
{
|
||||
System.Data.DataRow drow = DtPreguntas.FiltroPrimero(string.Format("CveUnoaUnoCuestionario={0}", CveUnoaUnoCuestionario));
|
||||
if (drow != null)
|
||||
{
|
||||
Comentario = drow["Comentario"].ToString();
|
||||
}
|
||||
System.Data.DataTable dt = new System.Data.DataTable();
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoaUnoCuestionarioPreguntas(CveUnoaUnoCuestionario);
|
||||
dt = ObjUnoa.DtResultados;
|
||||
}
|
||||
foreach (GridViewRow item in GvPreguntasCuestionario.Rows)
|
||||
{
|
||||
CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta");
|
||||
int CveUnoaUnoPregunta = item.DataKey("CveUnoaUnoPregunta").ToEntero();
|
||||
ChkConPregunta.Checked = false;
|
||||
if (dt.FiltraParametros(string.Format("CveUnoaUnoPregunta={0}", CveUnoaUnoPregunta)).Rows.Count > 0)
|
||||
{
|
||||
ChkConPregunta.Checked = true;
|
||||
}
|
||||
}
|
||||
LnkGuardarCuestionario.Text = "Actualizar";
|
||||
}
|
||||
else
|
||||
{
|
||||
Cuestionario = "";
|
||||
Comentario = "";
|
||||
foreach (GridViewRow item in GvPreguntasCuestionario.Rows)
|
||||
{
|
||||
CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta");
|
||||
ChkConPregunta.Checked = false;
|
||||
}
|
||||
LnkGuardarCuestionario.Text = "Guardar";
|
||||
}
|
||||
TxtCuestionario.Text = Cuestionario;
|
||||
TxtCuestComentario.Text = Comentario;
|
||||
UpCuestionario.Update();
|
||||
CargarSeguirA();
|
||||
UpSeguirA.Update();
|
||||
openmodalseguir();
|
||||
}
|
||||
//protected void LnkCancelarCuestionario_Click(object sender, EventArgs e)
|
||||
//{
|
||||
|
||||
// CcveUnoaUnoCuestionario = -1;
|
||||
// LnkGuardarCuestionario.Text = "Guardar";
|
||||
// LnkCancelarCuestionario.Visible = false;
|
||||
// UpCuestionario.Update();
|
||||
// openmodalseguir();
|
||||
//}
|
||||
|
||||
//protected void LnkEditarCuestionario_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// TxtCuestionario.Text = "";
|
||||
// CcveUnoaUnoPregunta = -1;
|
||||
// TxtPregunta.Focus();
|
||||
|
||||
// GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
// CcveUnoaUnoCuestionario = gvRow.DataKey("CveUnoaUnoCuestionario").ToEntero();
|
||||
// string Cuestionario = gvRow.DataKey("Cuestionario");
|
||||
// TxtCuestionario.Text = Cuestionario;
|
||||
// System.Data.DataTable dt = new System.Data.DataTable();
|
||||
// using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
// {
|
||||
// ObjUnoa.GetUnoaUnoCuestionarioPreguntas(CcveUnoaUnoCuestionario);
|
||||
// dt = ObjUnoa.DtResultados;
|
||||
// }
|
||||
// foreach (GridViewRow item in GvPreguntasCuestionario.Rows)
|
||||
// {
|
||||
// CheckBox ChkConPregunta=item.FCCheckBox("ChkConPregunta");
|
||||
// int CveUnoaUnoPregunta = item.DataKey("CveUnoaUnoPregunta").ToEntero();
|
||||
// ChkConPregunta.Checked = false;
|
||||
// if(dt.FiltraParametros(string.Format("CveUnoaUnoPregunta={0}", CveUnoaUnoPregunta)).Rows.Count > 0)
|
||||
// {
|
||||
// ChkConPregunta.Checked = true;
|
||||
// }
|
||||
|
||||
// }
|
||||
// LnkGuardarCuestionario.Text = "Actualizar";
|
||||
// LnkCancelarCuestionario.Visible = true;
|
||||
// UpCuestionario.Update();
|
||||
// openmodalseguir();
|
||||
//}
|
||||
|
||||
//protected void LnkEliminarCuestionario_Click(object sender, EventArgs e)
|
||||
//{
|
||||
|
||||
// GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
// CcveUnoaUnoCuestionario = gvRow.DataKey("CveUnoaUnoCuestionario").ToEntero();
|
||||
// bool continuar = true;
|
||||
// using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
// {
|
||||
// continuar = ObjUnoa.RemoveUnoaUnoCuestionario(CcveUnoaUnoPregunta, UsuarioActual.CveUsuario);
|
||||
// }
|
||||
// if (continuar)
|
||||
// {
|
||||
// CcveUnoaUnoCuestionario = -1;
|
||||
// Alert("El cuestionario se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
// cargarCuestionario();
|
||||
// }
|
||||
// openmodalseguir();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
private void CargarSeguirA()
|
||||
{
|
||||
System.Data.DataTable dt = null;
|
||||
int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero();
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, -1);
|
||||
dt = ObjUnoa.DtResultados;
|
||||
}
|
||||
bool isdtok = (dt != null && dt.Rows.Count > 0);
|
||||
foreach (GridViewRow item in GvUsuarioCuest.Rows)
|
||||
{
|
||||
CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta");
|
||||
int CveSeguir = item.DataKey("CveUsuario").ToEntero();
|
||||
if (isdtok && dt.FiltraParametros(string.Format("CveSeguir={0}", CveSeguir)).Rows.Count > 0)
|
||||
{
|
||||
ChkConPregunta.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ChkConPregunta.Checked = false;
|
||||
}
|
||||
}
|
||||
CargarSiguiendoA();
|
||||
UpContenido.Update();
|
||||
UpSeguirA.Update();
|
||||
}
|
||||
protected void LnkGuardarSeguirA_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
bool continuar = true;
|
||||
string msg = "";
|
||||
int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero();
|
||||
//int CveSeguir = DdlUsuario.SelectedValue.ToEntero();
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.IniciaTransacSQL();
|
||||
|
||||
foreach (GridViewRow item in GvUsuarioCuest.Rows)
|
||||
{
|
||||
CheckBox ChkConPregunta = item.FCCheckBox("ChkConPregunta");
|
||||
int CveSeguir = item.DataKey("CveUsuario").ToEntero();
|
||||
if (continuar)
|
||||
{
|
||||
continuar = ObjUnoa.UpUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, CveSeguir, ChkConPregunta.Checked);
|
||||
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
msg = "El cuestionario se ha actualizado correctamente";
|
||||
ObjUnoa.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjUnoa.RollBack();
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
//CcveUnoaUnoCuestionario = -1;
|
||||
Alert(msg, ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
CargarSeguirA();
|
||||
RegistraScript(string.Format("$('#{0}').modal('hide');", idDivModalSeguir));
|
||||
}
|
||||
openmodalseguir();
|
||||
}
|
||||
|
||||
//protected void LnkEliminarCuestionarioUser_Click(object sender, EventArgs e)
|
||||
//{
|
||||
|
||||
|
||||
// bool continuar = true;
|
||||
// int cveUnoaUnoCuestionario = DdlCuestionario.SelectedValue.ToEntero();
|
||||
// int CveSeguir = DdlUsuario.SelectedValue.ToEntero();
|
||||
// using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
// {
|
||||
// continuar = ObjUnoa.AddUnoaUnoCuestionario_Usuarios(cveUnoaUnoCuestionario, UsuarioActual.CveUsuario, CveSeguir);
|
||||
// }
|
||||
// if (continuar)
|
||||
// {
|
||||
// //CcveUnoaUnoCuestionario = -1;
|
||||
// Alert("El cuestionario se ha eliminado correctamente", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
// CargarSeguirA();
|
||||
// }
|
||||
// openmodalseguir();
|
||||
//}
|
||||
|
||||
|
||||
protected void TabContainerSeguir_ActiveTabChanged(object sender, EventArgs e)
|
||||
{
|
||||
LnkGuardarSeguirA.Visible = false;
|
||||
if (TabContainerSeguir.ActiveTab == TabUsuarios)
|
||||
{
|
||||
if (DdlCuestionario.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
TabContainerSeguir.ActiveTab = TabCuestionario;
|
||||
Alert("debe Seleccionar un cuestioniario", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
else
|
||||
{
|
||||
LnkGuardarSeguirA.Visible = true;
|
||||
}
|
||||
}
|
||||
openmodalseguir();
|
||||
UpSeguirA.Update();
|
||||
}
|
||||
|
||||
|
||||
protected void SiguiendoAUser_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToEntero();
|
||||
string Nombre = gvRow.DataKey("Nombre");
|
||||
LtlTitulosiguiendoA.Text = Nombre;
|
||||
gvPregResSiguiendoA.DataSource = null;
|
||||
using (ClsOIEventos ObjUnoa = new ClsOIEventos())
|
||||
{
|
||||
ObjUnoa.GetUnoAUnoSiguiendoA(UsuarioActual.CveUsuario, CveUsuario, UsuarioActual.CveEmpresa);
|
||||
gvPregResSiguiendoA.DataSource = ObjUnoa.DtResultados;
|
||||
}
|
||||
gvPregResSiguiendoA.DataBind();
|
||||
RegistraScript(string.Format("$('#{0}').modal();", idDivModalSiguiendoA));
|
||||
UpModalSiguiendoA.Update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user