100 lines
3.1 KiB
C#
100 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using Extensiones;
|
|
using System.Data;
|
|
|
|
public partial class AF_CatCheckListActividadesGrupos : ClsPaginas
|
|
{
|
|
private int CveCheckListActividadGrupo
|
|
{
|
|
get
|
|
{
|
|
return ViewState["CveCheckListActividadGrupo"].ToString().ToEntero();
|
|
}
|
|
|
|
set
|
|
{
|
|
ViewState["CveCheckListActividadGrupo"] = value;
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
CargaDatos();
|
|
}
|
|
}
|
|
|
|
private void CargaDatos()
|
|
{
|
|
ClsAF ObjAF = new ClsAF();
|
|
if (ObjAF.GetCheckListActividadGrupo(-1))
|
|
{
|
|
GvDatos.DataSource = ObjAF.DtResultados;
|
|
GvDatos.DataBind();
|
|
}
|
|
|
|
ObjAF.Dispose();
|
|
}
|
|
|
|
protected void BtnAgregarGrupoCheckListD_Click(object sender, EventArgs e)
|
|
{
|
|
BtnAgregarGrupoCheckList.Text = "Agregar";
|
|
TxtGrupoCheckList.Text = "";
|
|
UpModalTiposD.Update();
|
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarGrupoCheckListD"));
|
|
}
|
|
|
|
protected void LnkEditar_Click(object sender, EventArgs e)
|
|
{
|
|
BtnAgregarGrupoCheckList.Text = "Actualizar";
|
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
|
CveCheckListActividadGrupo = GvRow.DataKey("CveCheckListActividadGrupo").ToEntero();
|
|
TxtGrupoCheckList.Text = GvRow.DataKey("CheckListActividadGrupo");
|
|
UpModalTiposD.Update();
|
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarGrupoCheckListD"));
|
|
}
|
|
|
|
protected void LnkEliminar_Click(object sender, EventArgs e)
|
|
{
|
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
|
CveCheckListActividadGrupo = GvRow.DataKey("CveCheckListActividadGrupo").ToEntero();
|
|
ClsAF ObjAF = new ClsAF();
|
|
if (ObjAF.DeleteCheckListActividadGrupo(CveCheckListActividadGrupo))
|
|
{
|
|
CargaDatos();
|
|
UpDatos.Update();
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarGrupoCheckListD"));
|
|
Alert("Se eliminó el Grupo de CheckList correctamente");
|
|
}
|
|
ObjAF.Dispose();
|
|
}
|
|
|
|
protected void BtnAgregarGrupoCheckList_Click(object sender, EventArgs e)
|
|
{
|
|
ClsAF ObjAF = new ClsAF();
|
|
if (BtnAgregarGrupoCheckList.Text == "Agregar")
|
|
{
|
|
if (ObjAF.AddCheckListActividadGrupo(TxtGrupoCheckList.Text))
|
|
{
|
|
Alert("Se agregó el Grupo de CheckList correctamente");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (ObjAF.UpdateCheckListActividadGrupo(CveCheckListActividadGrupo, TxtGrupoCheckList.Text))
|
|
{
|
|
Alert("Se actualizó el Grupo de CheckList correctamente");
|
|
}
|
|
}
|
|
ObjAF.Dispose();
|
|
CargaDatos();
|
|
UpDatos.Update();
|
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarGrupoCheckListD"));
|
|
}
|
|
} |