From da2dc0883f823b0e4ea014753ed1fb445eca5035 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 22 Aug 2020 13:31:01 -0700 Subject: [PATCH] =?UTF-8?q?cat=C3=A1logo=20de=20checklist=20listo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AF/CatCheckList.aspx | 84 +++++++++++++++++++++++++----- AF/CatCheckList.aspx.cs | 110 +++++++++++++++++++++++++++++++++++++++- App_Code/ClsPaginas.vb | 1 + 3 files changed, 181 insertions(+), 14 deletions(-) diff --git a/AF/CatCheckList.aspx b/AF/CatCheckList.aspx index c7c954225..790db7f2a 100644 --- a/AF/CatCheckList.aspx +++ b/AF/CatCheckList.aspx @@ -1,16 +1,74 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CatCheckList.aspx.cs" Inherits="AF_CatCheckList" %> +<%@ Page Title="AF - Catálogo de CheckList" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatCheckList.aspx.cs" Inherits="AF_CatCheckList" %> - +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de CheckList + + + + +
  • + +
  • - - - - - -
    -
    - + + + + + + + + + + + + + + + + + + + + + - - - + + + \ 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)