catálogo de checklist listo
This commit is contained in:
@@ -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" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de CheckList
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarCheckListD" OnClick="BtnAgregarCheckListD_Click" data-toggle="tooltip" data-placement="left" title="Agregar un CheckList" Text="<i class='fa fa-plus'></i>Agregar CheckList"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCheckList, CveTipoServicio, CveCheckListActividad, Nombre, CheckListActividad" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Nombre" DataField="Nombre" />
|
||||
<asp:BoundField HeaderText="CheckList Actividad" DataField="CheckListActividad" />
|
||||
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivAgregarTiposServiciosD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">CheckList</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoServicio" DataTextField="Nombre" DataValueField="CveTipoServicio" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlTipoServicio.ClientID.ToString()%>">Tipo Servicio:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlTipoServicio" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlTipoServicio" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Servicio''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCheckListActividad" DataTextField="CheckListActividad" DataValueField="CveCheckListActividad" CausesValidation="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlCheckListActividad.ClientID.ToString()%>">CheckList Actividad:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlCheckListActividad" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlCheckListActividad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Mantenimiento''</b> es necesario." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarCheckList" OnClick="BtnAgregarCheckList_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user