avance
This commit is contained in:
@@ -2743,8 +2743,291 @@ Public Class ClsOIEventos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "OI_Documentos"
|
||||
|
||||
#Region "OI_DocumentosCategorias"
|
||||
Public Function GetDocumentoCategoria(Optional CveCategoria As Integer = -1, Optional Categoria As String = "-1") As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosCategoriasGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
|
||||
.Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddDocumentoCategoria(Categoria As String, Estado As Boolean) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosCategoriasAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
|
||||
.Add("@Estado", SqlDbType.Bit).Value = Estado
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateDocumentoCategoria(CveCategoria As Integer, Categoria As String, Estado As Boolean) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosCategoriasUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
|
||||
.Add("@Categoria", SqlDbType.NVarChar).Value = Categoria
|
||||
.Add("@Estado", SqlDbType.Bit).Value = Estado
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveDocumentoCategoria(CveCategoria As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosCategoriasRemove")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCategoria", SqlDbType.NVarChar).Value = CveCategoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar la categoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "OI_DocumentosSubCategoria"
|
||||
Public Function GetDocumentoSubCategoria(Optional CveSubCategoria As Integer = -1, Optional SubCategoria As String = "-1") As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosSubCategoriasGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
|
||||
.Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddDocumentoSubCategoria(SubCategoria As String, CveCategoria As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosSubCategoriasAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
|
||||
.Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateDocumentoSubCategoria(CveSubCategoria As Integer, SubCategoria As String, CveCategoria As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosSubCategoriasUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
|
||||
.Add("@SubCategoria", SqlDbType.NVarChar).Value = SubCategoria
|
||||
.Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveDocumentoSubCategoria(CveSubCategoria As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosSubCategoriasRemove")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubCategoria", SqlDbType.NVarChar).Value = CveSubCategoria
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar la subcategoria", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#Region "Documentos"
|
||||
Public Function GetDocumento(CveDocumento As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddDocumento(CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String,
|
||||
Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
|
||||
.Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion
|
||||
.Add("@Observacion", SqlDbType.NVarChar).Value = Observacion
|
||||
.Add("@Version", SqlDbType.NVarChar).Value = Version
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico
|
||||
.Add("@Responsable", SqlDbType.NVarChar).Value = Responsable
|
||||
.Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion
|
||||
.Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateDocumento(CveDocumento As Integer, CveSubCategoria As Integer, Descripcion As String, Observacion As String, Version As String, CveEstatus As Integer, ArchivoFisico As String,
|
||||
Responsable As String, FechaAprobacion As Date, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosUpdate")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
|
||||
.Add("@CveSubCategoria", SqlDbType.Int).Value = CveSubCategoria
|
||||
.Add("@Descripcion", SqlDbType.NVarChar).Value = Descripcion
|
||||
.Add("@Observacion", SqlDbType.NVarChar).Value = Observacion
|
||||
.Add("@Version", SqlDbType.NVarChar).Value = Version
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@ArchivoFisico", SqlDbType.NVarChar).Value = ArchivoFisico
|
||||
.Add("@Responsable", SqlDbType.NVarChar).Value = Responsable
|
||||
.Add("@FechaAprobacion", SqlDbType.Date).Value = FechaAprobacion
|
||||
.Add("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el Documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveDocumento(CveDocumento As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosRemove")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
#End Region
|
||||
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||
|
||||
@@ -4552,6 +4552,8 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/OI/RepDesarrollo.aspx".ToUpper(), 475)
|
||||
PaginaDict.Add("/OI/DesarrolloWizard.aspx".ToUpper(), 474)
|
||||
PaginaDict.Add("/OI/SubidasADS.aspx".ToUpper(), 476)
|
||||
PaginaDict.Add("/OI/CatDocumentoCategoria.aspx".ToUpper(), 760)
|
||||
PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), 761)
|
||||
#End Region
|
||||
#Region "Planeacion"
|
||||
'PLANEACIÓN
|
||||
|
||||
76
OI/CatDocumentoCategoria.aspx
Normal file
76
OI/CatDocumentoCategoria.aspx
Normal file
@@ -0,0 +1,76 @@
|
||||
<%@ Page Title="OI - Catálogo de Categorías de Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatDocumentoCategoria.aspx.cs" Inherits="OI_CatDocumentoCategoria" %>
|
||||
|
||||
<%@ 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 Categorías de Documentos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarCategoria" OnClick="BtnAgregarCategoria_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Categoría"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</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="CveCategoria,Estado,Estatus,Categoria" EmptyDataText="No se encontraron Categorías de Documentos Registrados" ToolTip="Listado de Categorías de Documentos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Categoría" DataField="Categoria" />
|
||||
<asp:BoundField HeaderText="Estado" DataField="Estatus" />
|
||||
<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="DivAgregarTiposD" 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">Agregar Categoría de Documentos</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCategoria" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtCategoria" runat="server" ControlToValidate="TxtCategoria" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Categoría''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtCategoria">Categoría:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Estatus:</label>
|
||||
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Text=" " />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarCategoriaDoc" OnClick="BtnAgregarCategoriaDoc_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>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
104
OI/CatDocumentoCategoria.aspx.cs
Normal file
104
OI/CatDocumentoCategoria.aspx.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
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 OI_CatDocumentoCategoria : ClsPaginas
|
||||
{
|
||||
|
||||
private int CveCategoria
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveCategoria"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveCategoria"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoCategoria())
|
||||
{
|
||||
GvDatos.DataSource = ObjOI.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarCategoria_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarCategoriaDoc.Text = "Agregar";
|
||||
TxtCategoria.Text = "";
|
||||
ChkEstatus.Checked = true;
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarCategoriaDoc.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveCategoria = GvRow.DataKey("CveCategoria").ToEntero();
|
||||
TxtCategoria.Text = GvRow.DataKey("Categoria");
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estado").ToString() == "True";
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveCategoria = GvRow.DataKey("CveCategoria").ToEntero();
|
||||
ClsCompras ObjCompras = new ClsCompras();
|
||||
if (ObjCompras.RemoveTipoGasto(CveCategoria))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se eliminó la Categoría de Documento correctamente");
|
||||
}
|
||||
ObjCompras.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarCategoriaDoc_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (BtnAgregarCategoriaDoc.Text == "Agregar")
|
||||
{
|
||||
if (ObjOI.AddDocumentoCategoria(TxtCategoria.Text,ChkEstatus.Checked))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se agregó la Categoría de Documento correctamente");
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (ObjOI.UpdateDocumentoCategoria(CveCategoria,TxtCategoria.Text,ChkEstatus.Checked))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se actualizó la Categoría de Documento correctamente");
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
}
|
||||
76
OI/CatDocumentoSubCategoria.aspx
Normal file
76
OI/CatDocumentoSubCategoria.aspx
Normal file
@@ -0,0 +1,76 @@
|
||||
<%@ Page Title="OI - Catálogo de Subcategorías de Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatDocumentoSubCategoria.aspx.cs" Inherits="OI_CatDocumentoSubCategoria" %>
|
||||
|
||||
<%@ 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 Subcategorías de Documentos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarSubCategoria" OnClick="BtnAgregarSubCategoria_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Subcategoría"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</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="CveSubCategoria,SubCategoria,CveCategoria,Categoria" EmptyDataText="No se encontraron Categorías de Documentos Registrados" ToolTip="Listado de Categorías de Documentos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Subcategoría" DataField="SubCategoria" />
|
||||
<asp:BoundField HeaderText="Categoría" DataField="Categoria" />
|
||||
<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="DivAgregarTiposD" 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">Agregar Categoría de Documentos</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSubCategoria" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtSubCategoria" runat="server" ControlToValidate="TxtSubCategoria" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Categoría''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtSubCategoria">Subcategoría:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<label for="TxtSubCategoria">Categoria:</label>
|
||||
<asp:DropDownList ID="DdlCategorias" CssClass="form-control select2me" runat="server" DataTextField="Categoria" DataValueField="CveCategoria"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAgregarSubCategoriaDoc" OnClick="BtnAgregarSubCategoriaDoc_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>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
114
OI/CatDocumentoSubCategoria.aspx.cs
Normal file
114
OI/CatDocumentoSubCategoria.aspx.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
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 OI_CatDocumentoSubCategoria : ClsPaginas
|
||||
{
|
||||
private int CveSubCategoria
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveSubCategoria"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveSubCategoria"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
CargaCategoria();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoSubCategoria())
|
||||
{
|
||||
GvDatos.DataSource = ObjOI.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
private void CargaCategoria()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoCategoria())
|
||||
{
|
||||
DdlCategorias.DataSource = ObjOI.DtResultados.FiltraParametros("Estado = 1");
|
||||
DdlCategorias.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarSubCategoria_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarSubCategoriaDoc.Text = "Agregar";
|
||||
TxtSubCategoria.Text = "";
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarSubCategoriaDoc.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveSubCategoria = GvRow.DataKey("CveSubCategoria").ToEntero();
|
||||
TxtSubCategoria.Text = GvRow.DataKey("SubCategoria");
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveSubCategoria = GvRow.DataKey("CveSubCategoria").ToEntero();
|
||||
ClsCompras ObjCompras = new ClsCompras();
|
||||
if (ObjCompras.RemoveTipoGasto(CveSubCategoria))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se eliminó la Categoría de Documento correctamente");
|
||||
}
|
||||
ObjCompras.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarSubCategoriaDoc_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (BtnAgregarSubCategoriaDoc.Text == "Agregar")
|
||||
{
|
||||
if (ObjOI.AddDocumentoSubCategoria(TxtSubCategoria.Text, DdlCategorias.SelectedValue.ToEntero()))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se agregó la Categoría de Documento correctamente");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjOI.UpdateDocumentoSubCategoria(CveSubCategoria, TxtSubCategoria.Text, DdlCategorias.SelectedValue.ToEntero()))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se actualizó la Categoría de Documento correctamente");
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
}
|
||||
49
OI/Documentos.aspx
Normal file
49
OI/Documentos.aspx
Normal file
@@ -0,0 +1,49 @@
|
||||
<%@ Page Title="OI - Documentos" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Documentos.aspx.cs" Inherits="OI_Documentos" %>
|
||||
|
||||
<%@ 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">
|
||||
Documentos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarDocumento" data-toggle="tooltip" data-placement="left" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Documento"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</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="CveDocumento,SubCategoria,Descripcion,Observacion,Version,Responsable,FechaAprobacion,FechaInicioVigencia"
|
||||
EmptyDataText="No se encontraron Documentos Registrados" ToolTip="Listado de Documentos" CssClass="table table-striped table-advance table-hover"
|
||||
Style="margin-top: -10px; text-align: center; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Descripcion" DataField="Descripcion" />
|
||||
<asp:BoundField HeaderText="Observacion" DataField="Observacion" />
|
||||
<asp:BoundField HeaderText="Versión" DataField="Version" />
|
||||
<asp:BoundField HeaderText="Responsable" DataField="Responsable" />
|
||||
<asp:BoundField HeaderText="Fecha Aprobacion" DataField="FechaAprobacion" />
|
||||
<asp:BoundField HeaderText="Fecha Inicio Vigencia" DataField="FechaInicioVigencia" />
|
||||
<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>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
30
OI/Documentos.aspx.cs
Normal file
30
OI/Documentos.aspx.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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 OI_Documentos : ClsPaginas
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumento(-1,UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjOI.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user