-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/AF/CatCheckList.aspx.cs b/AF/CatCheckList.aspx.cs
index 4742625b9..d488bf25c 100644
--- a/AF/CatCheckList.aspx.cs
+++ b/AF/CatCheckList.aspx.cs
@@ -4,11 +4,119 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+using Extensiones;
+using System.Data;
-public partial class AF_CatCheckList : System.Web.UI.Page
+public partial class AF_CatCheckList : ClsPaginas
{
+ private int CveCheckList
+ {
+ get
+ {
+ return ViewState["CveCheckList"].ToString().ToEntero();
+ }
+
+ set
+ {
+ ViewState["CveCheckList"] = value;
+ }
+ }
+
protected void Page_Load(object sender, EventArgs e)
{
+ if (!IsPostBack)
+ {
+ CargaDatos();
+ }
+ }
+ private void CargaDatos()
+ {
+ ClsAF ObjAF = new ClsAF();
+ if (ObjAF.GetCheckList(-1, -1, -1))
+ {
+ GvDatos.DataSource = ObjAF.DtResultados;
+ GvDatos.DataBind();
+ }
+
+ DdlTipoServicio.Items.Clear();
+ if (ObjAF.GetTiposServicios(-1,-1,-1,UsuarioActual.CveEmpresa))
+ {
+ DdlTipoServicio.DataSource = ObjAF.DtResultados;
+ DdlTipoServicio.DataBind();
+ DdlTipoServicio.Items.Insert(0, new ListItem("Seleccione","-1"));
+ }
+
+ DdlCheckListActividad.Items.Clear();
+ if (ObjAF.GetCheckListActividad(-1, -1))
+ {
+ DdlCheckListActividad.DataSource = ObjAF.DtResultados;
+ DdlCheckListActividad.DataBind();
+ DdlCheckListActividad.Items.Insert(0, new ListItem("Seleccione", "-1"));
+ }
+
+ ObjAF.Dispose();
+ }
+
+ protected void BtnAgregarCheckListD_Click(object sender, EventArgs e)
+ {
+ BtnAgregarCheckList.Text = "Agregar";
+ DdlTipoServicio.SelectedValueExist(-1);
+ DdlCheckListActividad.SelectedValueExist(-1);
+ UpModalTiposD.Update();
+ RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD"));
+ }
+
+ protected void LnkEditar_Click(object sender, EventArgs e)
+ {
+ BtnAgregarCheckList.Text = "Actualizar";
+ GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
+ CveCheckList = GvRow.DataKey("CveCheckList").ToEntero();
+ DdlTipoServicio.SelectedValueExist(GvRow.DataKey("CveTipoServicio"));
+ DdlCheckListActividad.SelectedValueExist(GvRow.DataKey("CveCheckListActividad"));
+ UpModalTiposD.Update();
+ RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD"));
+ }
+
+ protected void LnkEliminar_Click(object sender, EventArgs e)
+ {
+ GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
+ CveCheckList = GvRow.DataKey("CveCheckList").ToEntero();
+ ClsAF ObjAF = new ClsAF();
+ if (ObjAF.DeleteCheckList(CveCheckList))
+ {
+ CargaDatos();
+ UpDatos.Update();
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD"));
+ Alert("Se eliminó el CheckList correctamente");
+ }
+ ObjAF.Dispose();
+ }
+
+ protected void BtnAgregarCheckList_Click(object sender, EventArgs e)
+ {
+ ClsAF ObjAF = new ClsAF();
+ if (BtnAgregarCheckList.Text == "Agregar")
+ {
+ if (ObjAF.AddCheckList(DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero()))
+ {
+ CargaDatos();
+ UpDatos.Update();
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD"));
+ Alert("Se agregó el CheckList correctamente");
+ }
+ }
+ else
+ {
+ if (ObjAF.UpdateCheckList(CveCheckList, DdlTipoServicio.SelectedValue.ToEntero(), DdlCheckListActividad.SelectedValue.ToEntero()))
+ {
+ CargaDatos();
+ UpDatos.Update();
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD"));
+ Alert("Se actualizó el CheckList correctamente");
+ }
+ }
+ ObjAF.Dispose();
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosD"));
}
}
\ No newline at end of file
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 0b5f11d3e..1e93bc42a 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -3959,6 +3959,7 @@ Public Class ClsPaginas
PaginaDict.Add("/AF/CatCheckListActividadesGrupos.aspx".ToUpper(), 769)
PaginaDict.Add("/AF/CatCheckListTipo.aspx".ToUpper(), 770)
PaginaDict.Add("/AF/CatCheckListActividades.aspx".ToUpper(), 771)
+ PaginaDict.Add("/AF/CatCheckList.aspx".ToUpper(), 772)
PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1)
PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1)