Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -87,8 +87,8 @@ Partial Class AF_CatAF
|
||||
DdlEstatus.DataSource = GlobalDTEstadoActivoFijo
|
||||
DdlEstatus.DataBind()
|
||||
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto)
|
||||
GvDatos.Columns(7).HeaderText = LblSubProyecto.Text
|
||||
DivProyecto.Visible = LblProyecto.Visible
|
||||
DivProyectoDdl.Visible = LblProyecto.Visible
|
||||
'DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.CveEmpresa)
|
||||
|
||||
@@ -2743,8 +2743,355 @@ 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 ListadoDocumentos(CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_ListarDocumentos")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.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 listado de documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
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, CveDocumentoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||
|
||||
Dim Retorno As Integer = -1
|
||||
|
||||
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("@CveDocumentoPadre", SqlDbType.Int).Value = CveDocumentoPadre
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveDocumento", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@CveDocumento").Value.ToString().ToEntero()
|
||||
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
|
||||
|
||||
#Region "OI_DocumentosAutorizacion"
|
||||
Public Function AddDocumentoAutorizacion(CveDocumento As Integer, CveUsuario As Integer, Adjunto As String) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("OI_DocumentosAutorizacionesAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveDocumento", SqlDbType.Int).Value = CveDocumento
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@Adjunto", SqlDbType.NVarChar).Value = Adjunto
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el usuario para autorizar el documento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetDocumentoAutorizacion(CveDocumento As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OI_DocumentosAutorizacionesGet")
|
||||
|
||||
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 obtener el usuario o usuarios para autorizar 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)
|
||||
|
||||
@@ -4590,6 +4590,10 @@ 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)
|
||||
PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), 762)
|
||||
PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), 763)
|
||||
#End Region
|
||||
#Region "Planeacion"
|
||||
'PLANEACIÓN
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
Proyecto:
|
||||
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="Div1">Aplica NC:</div>
|
||||
<div class="col-md-1" runat="server" id="Div1">Aplica NC/Dev:</div>
|
||||
<div class="col-md-1" id="ds" style="width: 120px;">
|
||||
<asp:DropDownList CssClass="form-control select2me input-sm" ID="DdlAplicaNC" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1" data-toggle="tooltip" data-placement="left" title="Aplica Nota de Crédito">Aplica NC:</div>
|
||||
<div class="col-md-1" data-toggle="tooltip" data-placement="left" title="Aplica Nota de Crédito">Aplica NC/Dev:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="form-control input-sm" ID="AplicaNC" runat="server" AppendDataBoundItems="true" Style="height: 30px;">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
|
||||
@@ -682,7 +682,7 @@
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn">
|
||||
<asp:GridView ID="GvPS" ShowHeader="false" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS,Cantidad,CveUM,UM,PU,Descuento,OtrosGastos,CvePresupuestoEgreso,PS,Clasificacion,CveClasificacion,CveOrdenCompraDetalle,IVA,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,Obs,Total,CveProyecto,CveSubProyecto,Proyecto,SubProyecto,Consec,CveTipoGasto,NoDeducible,DifPSSat" GridLines="none" BorderWidth="0" EmptyDataText="Sin Productos o Servicios agregados" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn">
|
||||
<Columns>
|
||||
<%-- 0 --%>
|
||||
<asp:TemplateField ItemStyle-Width="15px">
|
||||
|
||||
@@ -1511,6 +1511,8 @@ Partial Class Compras_Compras
|
||||
CargaFletesAgregados()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
InicializaOC()
|
||||
|
||||
'Valida si el IVA del XML es está bien calculado
|
||||
@@ -2396,6 +2398,8 @@ Partial Class Compras_Compras
|
||||
EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero
|
||||
DdlTipoCompra.SelectedValueExist(dr("CveTipoCompra"))
|
||||
CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero
|
||||
|
||||
ChkEsNoDeducible.Checked = Boolean.Parse(dr("NoDeducible").ToString)
|
||||
'Select Case dr("PorcentajeIVA").ToString.ToDouble
|
||||
' Case 0
|
||||
' DdlIVA.SelectedValue = "1"
|
||||
@@ -2620,6 +2624,7 @@ Partial Class Compras_Compras
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("CveContrato", GetType(Integer))
|
||||
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
|
||||
|
||||
|
||||
|
||||
@@ -3612,6 +3617,7 @@ Partial Class Compras_Compras
|
||||
tPSCodigo = String.Format("{1} - {0}", ValorXML(node, "descripcion").ToUpper.Trim.Replace(vbCrLf, " ").Replace(vbLf, " ").Replace("'", "''"), ValorXML(node, "noIdentificacion").Trim)
|
||||
End If
|
||||
|
||||
'Alert(ValorXML(node, "ClaveProdServ").Trim)
|
||||
|
||||
If Version = "3.3" Then
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
@@ -3721,6 +3727,8 @@ Partial Class Compras_Compras
|
||||
'AGREGA A TMPDT
|
||||
AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS)
|
||||
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -4484,6 +4492,17 @@ Partial Class Compras_Compras
|
||||
'si el registro es manual, toma el mismo dato
|
||||
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
|
||||
|
||||
For Each GvRow As GridViewRow In GvPS.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If GvRow.FCCheckBox("ChkEsNoDeduciblePS").Checked = False Then
|
||||
EsNoDeducible = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
'Compra
|
||||
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
|
||||
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
|
||||
@@ -10755,6 +10774,14 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If e.Row.DataKey("DifPSSat").ToEntero = 1 Then
|
||||
'#e35b5a
|
||||
e.Row.BackColor = Drawing.Color.FromArgb(1, 227, 91, 90)
|
||||
e.Row.Attributes.Add("data-toggle", "tooltip")
|
||||
e.Row.Attributes.Add("title", "El código del producto del SAT no es igual al código del producto registrado.")
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
|
||||
@@ -11018,6 +11045,8 @@ Partial Class Compras_Compras
|
||||
TmpDT.Columns.Add("ImporteConImpuestos", GetType(Double))
|
||||
TmpDT.Columns.Add("NoDeducible", GetType(Boolean))
|
||||
|
||||
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
|
||||
|
||||
TmpDTOriginal = New DataTable
|
||||
TmpDTOriginal.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDTOriginal.Columns.Add("Cantidad", GetType(Decimal))
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
131
OI/DocumentoDetalle.aspx
Normal file
131
OI/DocumentoDetalle.aspx
Normal file
@@ -0,0 +1,131 @@
|
||||
<%@ Page Title="OI - Documentos detalle" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="DocumentoDetalle.aspx.cs" Inherits="OI_DocumentoDetalle" %>
|
||||
|
||||
<%@ 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 detalle
|
||||
</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>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir Excel</asp:LinkButton>
|
||||
</li>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpCliente" runat="server" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
|
||||
<div class="row form-group" style="width: 100%">
|
||||
<asp:UpdatePanel ID="UpDerecha" runat="server" UpdateMode="Conditional" class="col-md-2" style="width: 50%;">
|
||||
<ContentTemplate>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblDescripción" Text="Descripción" />
|
||||
<asp:TextBox runat="server" ID="TxtDescripcion" class="form-control" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtDescripcion" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpDoc"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblSubCategoria" Text="Subcategoría" /><br />
|
||||
<asp:DropDownList runat="server" ID="DdlSubCategoria" CssClass="select2me" Style="width: 30%" DataValueField="CveSubCategoria" DataTextField="SubCategoria">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblEstatus" Text="Estatus" /><br />
|
||||
<asp:DropDownList runat="server" ID="DdlEstatus" CssClass="select2me" Style="width: 30%">
|
||||
<asp:ListItem Value="1" Text="En Proceso" />
|
||||
<asp:ListItem Value="2" Text="Aprobado" />
|
||||
<asp:ListItem Value="1" Text="Rechazado" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblVersion" Text="Versión" />
|
||||
<asp:TextBox runat="server" ID="TxtVersion" class="form-control" Style="width: 30%" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtVersion" runat="server" ControlToValidate="TxtVersion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Versión''</b> es necesario, por favor ingréselo." ValidationGroup="GrpDoc"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblResponsable" Text="Responsable" />
|
||||
<asp:TextBox runat="server" ID="TxtResponsable" class="form-control" Style="width: 50%" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtResponsable" runat="server" ControlToValidate="TxtResponsable" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Responsable''</b> es necesario, por favor ingréselo." ValidationGroup="GrpDoc"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<asp:Label runat="server" ID="LblObs" Text="Observaciones" />
|
||||
<textarea runat="server" id="TxtObs" class="form-control" style="border: 1px solid #e5e5e5" rows="2"></textarea>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; font-size: 14px">
|
||||
<div>
|
||||
<asp:Label runat="server" ID="LblDocumentoFile" Text="Documento" />
|
||||
<asp:TextBox ID="TxtDocumentoFile" CssClass="ADSdropzone hidden" runat="server" Style="height: 100px"></asp:TextBox>
|
||||
</div>
|
||||
<div runat="server" id="DivDescargarArchivo" visible="false">
|
||||
<asp:Label runat="server" ID="LblDocumentoCargado" Text="Documento cargado:" />
|
||||
<asp:LinkButton runat="server" ID="LkbDescargarArchivo" Text="" OnClick="LkbDescargarArchivo_Click"/>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LkbDescargarArchivo" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpIzquierda" runat="server" UpdateMode="Conditional" class="col-md-2" style="width: 50%;">
|
||||
<ContentTemplate>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin: unset; height: 150px; text-align: center">
|
||||
<asp:Label runat="server" ID="LblUsuarios" Text="Usuarios" Font-Size="14px" /><br /><br />
|
||||
<div class="text-right" style="">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvUsuarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4; border:1px solid #e5e5e5" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvUsuarios.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatosUsuarios" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUsuarios" runat="server" AutoGenerateColumns="False" DataKeyNames="CveUsuario,Usuario,Correo" EmptyDataText="No se encontraron Categorías de Documentos Registrados"
|
||||
ToolTip="Listado de Categorías de Documentos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
Style="margin-top: -10px; text-align: center; width: 100%; overflow-x: hidden" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Unir">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="ChkUnir" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1" style="text-align: center; width: 100%">
|
||||
<br />
|
||||
<asp:LinkButton runat="server" ID="LkbGuardar" OnClick="LblGuardar_Click" Text="Guardar" class="btn btn-primary" ValidationGroup="GrpDoc"/>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
376
OI/DocumentoDetalle.aspx.cs
Normal file
376
OI/DocumentoDetalle.aspx.cs
Normal file
@@ -0,0 +1,376 @@
|
||||
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;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
public partial class OI_DocumentoDetalle : ClsPaginas
|
||||
{
|
||||
private int CveDocumento
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveDocumento"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveDocumento"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string ErrorMensaje
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["ErrorMensaje"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["ErrorMensaje"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string ArchivoAdjuntoNombre
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["ArchivoAdjuntoNombre"].ToString();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["ArchivoAdjuntoNombre"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Cargar();
|
||||
}
|
||||
}
|
||||
#region "CARGAS"
|
||||
private void CargarCveDocumento()
|
||||
{
|
||||
string CveDocumentoAux = Page.Request["CveDocumento"];
|
||||
if (CveDocumentoAux != null)
|
||||
{
|
||||
this.CveDocumento = CveDocumentoAux.ToEntero();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CveDocumento = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarMensajeNuevoEditado()
|
||||
{
|
||||
string MensajeNuevoEditado = Page.Request["Mensaje"];
|
||||
if (MensajeNuevoEditado == "Nuevo")
|
||||
{
|
||||
Alert("El Documento ha sido creado correctamente");
|
||||
}else if(MensajeNuevoEditado == "Editado")
|
||||
{
|
||||
Alert("Los cambios en el Documento han sido guardado correctamente");
|
||||
}
|
||||
}
|
||||
|
||||
private void CargarUsuarios()
|
||||
{
|
||||
GvUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
GvUsuarios.DataBind();
|
||||
}
|
||||
|
||||
private void CargarSubCategoria()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoSubCategoria())
|
||||
{
|
||||
DdlSubCategoria.DataSource = ObjOI.DtResultados;
|
||||
DdlSubCategoria.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
private void CargarResponsable()
|
||||
{
|
||||
TxtResponsable.Text = UsuarioActual.Nombre;
|
||||
}
|
||||
|
||||
private void CargarDocumentoYaExistente()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumento(this.CveDocumento, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
if (ObjOI.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow Documento = ObjOI.DtResultados.Rows[0];
|
||||
|
||||
TxtDescripcion.Text = Documento["Descripcion"].ToString();
|
||||
DdlSubCategoria.SelectedValue = Documento["CveSubCategoria"].ToString();
|
||||
DdlEstatus.SelectedValue = Documento["CveEstatus"].ToString();
|
||||
TxtVersion.Text = Documento["Version"].ToString();
|
||||
TxtResponsable.Text = Documento["Responsable"].ToString();
|
||||
TxtObs.InnerText = Documento["Observacion"].ToString();
|
||||
|
||||
ArchivoAdjuntoNombre = Documento["ArchivoFisico"].ToString();
|
||||
string[] ArchivoAux = Documento["ArchivoFisico"].ToString().Split('_');
|
||||
string ArchivoAdjunto = ArchivoAux[1];
|
||||
LkbDescargarArchivo.Text = ArchivoAdjunto;
|
||||
DivDescargarArchivo.Visible = true;
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
private void CargarUsuariosAutorizo()
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
if (ObjOI.GetDocumentoAutorizacion(this.CveDocumento))
|
||||
{
|
||||
DataTable UsuariosAutorizo = ObjOI.DtResultados;
|
||||
GridViewRowCollection UsuariosRowCollection = GvUsuarios.Rows;
|
||||
foreach (GridViewRow UsuarioRow in UsuariosRowCollection)
|
||||
{
|
||||
int CveUsuarioRow = UsuarioRow.DataKey("CveUsuario").ToEntero();
|
||||
UsuarioRow.FCCheckBox("ChkUnir").Checked = UsuariosAutorizo.COUNT("CveUsuario", string.Format("CveUsuario = {0}", CveUsuarioRow)) > 0;
|
||||
}
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
private void ConfiguracionActualizar()
|
||||
{
|
||||
LkbGuardar.Text = "Actualizar";
|
||||
}
|
||||
|
||||
private void Cargar()
|
||||
{
|
||||
CargarUsuarios();
|
||||
CargarSubCategoria();
|
||||
CargarResponsable();
|
||||
CargarCveDocumento();
|
||||
if (this.CveDocumento > 0)
|
||||
{
|
||||
CargarDocumentoYaExistente();
|
||||
CargarUsuariosAutorizo();
|
||||
ConfiguracionActualizar();
|
||||
CargarMensajeNuevoEditado();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "GENERAR DOCUMENTO"
|
||||
|
||||
|
||||
protected void LblGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsOIEventos ObjOI = new ClsOIEventos();
|
||||
ObjOI.IniciaTransacSQL();
|
||||
bool TieneError = false;
|
||||
|
||||
//Esta variable es requerida más adelante
|
||||
int CveDocumento = 0;
|
||||
string RutaArchivo = "-1";
|
||||
string CorreosNotificacion = "";
|
||||
byte[] ArchivoNotifiacion = null;
|
||||
|
||||
CveDocumento = GuardarDocumento(ref ObjOI, ref TieneError);//Se crea el Documento
|
||||
if (!TieneError) { RutaArchivo = AsignarArchivoAlDocumento(CveDocumento, ref ObjOI, ref TieneError); }//Se guarda el archivo fisico y se asigna al Documento generado
|
||||
if (!TieneError) { CorreosNotificacion = GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento
|
||||
if (!TieneError)
|
||||
{
|
||||
ArchivoNotifiacion = GenerarArchivoByte(RutaArchivo);
|
||||
NotificarPorCorreo(CorreosNotificacion, RutaArchivo, ArchivoNotifiacion);
|
||||
}
|
||||
|
||||
//Gestión de errores y resultados
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjOI.Commit();
|
||||
string ParamMensaje = LkbGuardar.Text == "Guardar" ? "Nuevo" : "Editado";//Esto indica la acción de usuario la cual se mostrará como alert al cargar la página
|
||||
Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}&Mensaje={1}", CveDocumento, ParamMensaje));
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjOI.RollBack();
|
||||
Alert(this.ErrorMensaje, ModExtensiones.TipoMensaje.MsgError);
|
||||
UpCliente.Update();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
|
||||
private int GuardarDocumento(ref ClsOIEventos ObjOI, ref bool TieneError)
|
||||
{
|
||||
int CveDocumentoPadre = this.CveDocumento > 0 ? this.CveDocumento : -1; //Asociamos el nuevo insert con un CveDocumento ya generado en caso de ser una nueva versión del documento
|
||||
|
||||
int CveDocumento = ObjOI.AddDocumento(DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, DdlEstatus.SelectedValue.ToEntero(),
|
||||
"", TxtResponsable.Text, CveDocumentoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
if (!(CveDocumento > 0))
|
||||
{
|
||||
TieneError = true;
|
||||
this.ErrorMensaje = "Hubo un error al guardar el Documento";
|
||||
}
|
||||
return CveDocumento;
|
||||
}
|
||||
|
||||
private string AsignarArchivoAlDocumento(int CveDocumento, ref ClsOIEventos ObjOI, ref bool TieneError)
|
||||
{
|
||||
|
||||
string RutaArchivo = GuardarArchivo(CveDocumento);
|
||||
if (RutaArchivo != "-1")
|
||||
{
|
||||
if (!ObjOI.UpdateDocumento(CveDocumento, -1, "-1", "-1", "-1", -1, RutaArchivo, "-1", ModExtensiones.MinFecha, -1, -1, -1))
|
||||
{
|
||||
TieneError = true;
|
||||
this.ErrorMensaje = "Hubo un error al asignar el archivo";
|
||||
}
|
||||
}
|
||||
else if (RutaArchivo == "Error")
|
||||
{
|
||||
TieneError = true;
|
||||
this.ErrorMensaje = "Hubo un error al guardar el archivo";
|
||||
}
|
||||
return RutaArchivo;
|
||||
}
|
||||
|
||||
private string GuardarUsuariosQueAutorizan(int CveDocumento, string RutaArchivo, ref ClsOIEventos ObjOI, ref bool TieneError)
|
||||
{
|
||||
StringBuilder CorreosReturn = new StringBuilder("");
|
||||
GridViewRowCollection GridUsuarios = GvUsuarios.Rows;
|
||||
foreach (GridViewRow GvRow in GridUsuarios)
|
||||
{
|
||||
if (GvRow.FCCheckBox("ChkUnir").Checked && !TieneError)
|
||||
{
|
||||
int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero();
|
||||
if (!ObjOI.AddDocumentoAutorizacion(CveDocumento, CveUsuario, RutaArchivo))
|
||||
{
|
||||
TieneError = true;
|
||||
this.ErrorMensaje = "Hubo un error al asignar los usuarios a este documento";
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
CorreosReturn.AppendFormat("{0},", GvRow.DataKey("Correo"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CorreosReturn.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "ARCHIVO ADJUNTO"
|
||||
|
||||
private string GuardarArchivo(int CveDocumento)
|
||||
{
|
||||
string RutaArchivo = "-1";
|
||||
List<Archivo> Filesgral = TxtDocumentoFile.getfiles().Archivos;
|
||||
if (TxtDocumentoFile.Text != "[]")
|
||||
{
|
||||
foreach (Archivo fileItem in Filesgral)
|
||||
{
|
||||
try
|
||||
{
|
||||
string Version = TxtVersion.Text;
|
||||
string NombreArchivo = fileItem.filenameO;
|
||||
//Preparamos la ruta donde moveremos el archivo cargado
|
||||
string NombreArchivoGuardado = string.Format("{0}_{1}", CveDocumento, NombreArchivo);
|
||||
string RutaDestino = UsuarioActual.Empresa.Ruta + @"DocumentosRepo\" + NombreArchivoGuardado;
|
||||
|
||||
//Si no existe la carpeta donde se guardan se crea
|
||||
if (!Directory.Exists(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo"))
|
||||
{
|
||||
Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"\DocumentosRepo");
|
||||
}
|
||||
//Movemos el archivo de la carpeta temporal hacia la carpeta de la empresa
|
||||
System.IO.File.Move(fileItem.FileUrl, RutaDestino);
|
||||
RutaArchivo = NombreArchivoGuardado;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Alert(e.Message);
|
||||
RutaArchivo = "Error";
|
||||
}
|
||||
}
|
||||
}
|
||||
return RutaArchivo;
|
||||
}
|
||||
|
||||
protected void LkbDescargarArchivo_Click(object sender, EventArgs e)
|
||||
{
|
||||
string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ArchivoAdjuntoNombre);
|
||||
byte[] archivoBytes = File.ReadAllBytes(Ruta);
|
||||
|
||||
HttpContext.Current.Response.Clear();
|
||||
HttpContext.Current.Response.ClearContent();
|
||||
HttpContext.Current.Response.ContentType = "application/octet-stream";
|
||||
HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", ArchivoAdjuntoNombre));
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", archivoBytes.Length.ToString());
|
||||
HttpContext.Current.Response.OutputStream.Write(archivoBytes, 0, archivoBytes.Length);
|
||||
HttpContext.Current.Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "NOTIFICACIONES CORREO"
|
||||
private void NotificarPorCorreo(string Para, string NombreArchivo, byte[] Adjunto)
|
||||
{
|
||||
string Descripcion = TxtDescripcion.Text;
|
||||
string Asunto = "Se le ha agregado como participante en el desarrollo de un Documento";
|
||||
string a = string.Format("{0} -- {1} --- {2}", Descripcion, Para, "");
|
||||
a.GuardaLog();
|
||||
|
||||
ClsSisMail Mail = new ClsSisMail();
|
||||
|
||||
if (Adjunto != null)
|
||||
{
|
||||
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
|
||||
ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
|
||||
|
||||
{
|
||||
var withBlock = itemMail;
|
||||
itemMail.ArchivoBinario = Adjunto;
|
||||
itemMail.NombreArchivo = NombreArchivo;
|
||||
}
|
||||
|
||||
LSRutasMail.Add(itemMail);
|
||||
|
||||
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Descripcion, "", LSRutasMail);
|
||||
Mail = null/* TODO Change to default(_) if this is not a reference type */;
|
||||
}
|
||||
else
|
||||
{
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Descripcion, "");
|
||||
Mail = null/* TODO Change to default(_) if this is not a reference type */;
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] GenerarArchivoByte(string NombreArchivo)
|
||||
{
|
||||
string ArchivoEnviar = string.Format(@"{0}DocumentosRepo\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo);
|
||||
if (File.Exists(ArchivoEnviar))
|
||||
{
|
||||
System.IO.FileStream fs = System.IO.File.Open(ArchivoEnviar, System.IO.FileMode.Open, System.IO.FileAccess.Read);
|
||||
byte[] buff = new byte[fs.Length + 1];
|
||||
if (fs.Length > 0)
|
||||
{
|
||||
fs.Read(buff, 0, (fs.Length.ToString().ToEntero() - 1));
|
||||
fs.Close();
|
||||
}
|
||||
return buff;
|
||||
}
|
||||
|
||||
return new byte[] { };
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
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:HyperLink runat="server" ID="BtnAgregarDocumento" data-toggle="tooltip" data-placement="left" NavigateUrl="/OI/DocumentoDetalle.aspx" title="Agregar un Defecto" Text="<i class='fa fa-plus'></i>Agregar Documento"></asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPDF" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Imprimir Excel</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:HyperLinkField HeaderText="Descripcion" DataTextField="Descripcion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:HyperLinkField HeaderText="Observación" DataTextField="Observacion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:HyperLinkField HeaderText="Versión" DataTextField="Version" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
|
||||
<asp:HyperLinkField HeaderText="SubCategoria" DataTextField="SubCategoria" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
|
||||
<asp:HyperLinkField HeaderText="Responsable" DataTextField="Responsable" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}" ItemStyle-HorizontalAlign="Left"/>
|
||||
<%--<asp:HyperLinkField HeaderText="Fecha Aprobacion" DataTextField="FechaAprobacion" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>--%>
|
||||
<asp:HyperLinkField HeaderText="Fecha Inicio Vigencia" DataTextField="FechaInicioVigencia" DataNavigateUrlFields="CveDocumento" DataNavigateUrlFormatString="/OI/DocumentoDetalle.aspx?CveDocumento={0}"/>
|
||||
</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.ListadoDocumentos(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjOI.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
ObjOI.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -329,7 +329,7 @@ Partial Class RH_CatCursos
|
||||
|
||||
Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/CursosInvitados.rdlc"
|
||||
|
||||
If Not File.Exists($"{Server.MapPath("~")}/{Archivo}") Then
|
||||
If Not File.Exists($"{Extensiones.DirectorioBaseEmpresas}/{Archivo}") Then
|
||||
Archivo = "Empresas/Grales/Formatos/CursosInvitados.rdlc"
|
||||
End If
|
||||
|
||||
@@ -613,7 +613,7 @@ Partial Class RH_CatCursos
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim objConstancias As New ClsConstancias
|
||||
Dim DocumenBitArray As Byte() = Nothing
|
||||
Dim RutaBase As String = Server.MapPath("~")
|
||||
Dim RutaBase As String = Extensiones.DirectorioBaseEmpresas
|
||||
|
||||
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
|
||||
|
||||
@@ -650,7 +650,7 @@ Partial Class RH_CatCursos
|
||||
Dim Contenido As String = "Buen día. Estimado(a) " & _Nombres & vbLf & vbLf & vbLf & vbLf & " Por medio de la presente, el departamento de Capital Humano de esta " & UsuarioActual.Empresa.Empresa & " le hace la cordial invitación para asistir al curso " & _Curso & " impartido por el capacitador " & _Capacitador & ", el día " & dia & " de " & mesArray(mes - 1) & " de " & año & " en lugar " & _Ubicacion & "." & vbLf & vbLf & vbLf & vbLf & "Esperamos contar con su asistencia."
|
||||
|
||||
If Not File.Exists(RutaArchivo) Then
|
||||
RutaArchivo = $"{Server.MapPath("~")}\Empresas\Grales\Formatos\CursoInvitacion.docx"
|
||||
RutaArchivo = $"{ Extensiones.DirectorioBaseEmpresas }\Empresas\Grales\Formatos\CursoInvitacion.docx"
|
||||
End If
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
@@ -658,24 +658,22 @@ Partial Class RH_CatCursos
|
||||
params.Add(New ReportParameter("Contenido", Contenido))
|
||||
params.Add(New ReportParameter("Fecha", Today.ToString))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
Dim DtDatos As New DataTable
|
||||
Return StreamPDF("Empresas/72/Formatos/CursoInvitacion.rdlc", DtDatos, params, "Invitación a curso", "PDF")
|
||||
|
||||
'Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo)
|
||||
'Dim Tags As New List(Of TagsDocumentos)
|
||||
Dim DtDatos As New DataTable
|
||||
|
||||
|
||||
Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo)
|
||||
Dim Tags As New List(Of TagsDocumentos)
|
||||
|
||||
|
||||
Tags.Add(New TagsDocumentos("{Curso}", _Curso))
|
||||
Tags.Add(New TagsDocumentos("{Contenido}", Contenido))
|
||||
|
||||
|
||||
objGemBoxDocument.SustituirTags(Tags)
|
||||
objGemBoxDocument.GuardarStreamPDF()
|
||||
|
||||
|
||||
'Tags.Add(New TagsDocumentos("{Curso}", _Curso))
|
||||
'Tags.Add(New TagsDocumentos("{Contenido}", Contenido))
|
||||
|
||||
''objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0)
|
||||
'objGemBoxDocument.SustituirTags(Tags)
|
||||
'objGemBoxDocument.GuardarStream()
|
||||
|
||||
|
||||
'Return objGemBoxDocument.GetBytesDocumento
|
||||
Return objGemBoxDocument.GetBytesDocumento
|
||||
|
||||
End Function
|
||||
|
||||
@@ -795,12 +793,9 @@ Partial Class RH_CatCursos
|
||||
ContenidoSB.AppendLine("")
|
||||
ContenidoSB.AppendLine("</table>")
|
||||
|
||||
|
||||
|
||||
|
||||
Dim BytesDocumento As Byte() = GenerarImvitacion(_Curso, _Capacitador, _Nombres, _CvePersonal, _Fecha, _Ubicacion)
|
||||
MandaCorreo("Invitación a Curso " & Curso, _Correo, "", ContenidoSB.ToString, BytesDocumento)
|
||||
|
||||
Dim BytesDocumento As Byte() = GenerarImvitacion(_Curso, _Capacitador, _Nombres, _CvePersonal, _Fecha, _Ubicacion)
|
||||
MandaCorreo("Invitación a Curso " & Curso, _Correo, "", ContenidoSB.ToString, BytesDocumento)
|
||||
|
||||
Contador = Contador + 1
|
||||
Dim valor As Boolean = False
|
||||
|
||||
|
||||
@@ -57,14 +57,10 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server" Style="color: #686868;"> <i class="fa fa-ad-pdf" style="margin-right:5px;"></i>Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" Style="color: #686868;"> <i class="fa fa-ad-pdf" style="margin-right:5px;"></i>Imprimir</asp:LinkButton>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-file-pdf-o" style="margin-right:5px;font-weight:bold"></i>Descargar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" Style="color: #686868;"><i class="fa fa-ad-excel" style="margin-right:5px"></i>Excel</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-file-excel-o" style="margin-right:5px;font-weight:bold"></i>Descargar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="HyperLink1" runat="server" Style="color: #686868;"><i class="fa fa-pencil" style="color:#686868;margin-left:3px;margin-right:2px"></i>Personalizar</asp:HyperLink>
|
||||
@@ -389,7 +385,6 @@
|
||||
<asp:Literal ID="LtlTurno" runat="server" Text='<%# Eval("Turno", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Puesto</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
@@ -434,7 +429,7 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>SubProyecto</HeaderTemplate>
|
||||
<%--<HeaderTemplate>SubProyecto</HeaderTemplate>--%>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
@@ -190,12 +190,12 @@ Partial Class RH_CatPersonal
|
||||
DdlEstatusPersonal.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaProyecto()
|
||||
DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
|
||||
DdlProyectoAsignado.DataBind()
|
||||
'DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
|
||||
'DdlProyectoAsignado.DataBind()
|
||||
CargaTipoCentroCosto()
|
||||
If DivProyecto.Visible Then
|
||||
CargaSubProyectos()
|
||||
End If
|
||||
'If DivProyecto.Visible Then
|
||||
' CargaSubProyectos()
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSubProyectos()
|
||||
@@ -214,34 +214,10 @@ Partial Class RH_CatPersonal
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoCentroCosto()
|
||||
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyectoAsignado.Items.Clear()
|
||||
DivProyecto.Visible = False
|
||||
LblProyecto.Visible = False
|
||||
LblSubProyecto.Text = "Sucursal:"
|
||||
|
||||
DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyectoAsignado.DataBind()
|
||||
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
|
||||
DdlSubProyectoAsignado.Items.Clear()
|
||||
DivProyecto.Visible = False
|
||||
LblProyecto.Visible = False
|
||||
LblSubProyecto.Text = "Proyecto:"
|
||||
|
||||
DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSubProyectoAsignado.DataBind()
|
||||
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
|
||||
LblProyecto.Text = "Sucursal:"
|
||||
LblSubProyecto.Text = "Proyecto:"
|
||||
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
|
||||
LblProyecto.Text = "Proyecto:"
|
||||
LblSubProyecto.Text = "Sucursal:"
|
||||
End If
|
||||
CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyecto, LblSubProyecto)
|
||||
DivProyecto.Visible = LblProyecto.Visible
|
||||
ChkSubProyecto.Text = LblSubProyecto.Text
|
||||
GvDatos.Columns(12).HeaderText = LblSubProyecto.Text
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSupervisores()
|
||||
|
||||
@@ -568,20 +568,20 @@
|
||||
<label for="<%= DdlClienteAsignado.ClientID.ToString()%>">Cliente: </label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivProyectosAsignado">
|
||||
<asp:Label runat="server" ID="LblProyectoAsignado" CssClass="form-line" for="<%= DdlProyectoAsignado.ClientID.ToString()%>" style="margin-bottom:unset;color:#888888">Proyecto: </asp:Label>
|
||||
<asp:DropDownList ID="DdlProyectoAsignado" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataTextField="Proyecto" DataValueField="CveProyecto" CssClass="form-control input-sm select2me" ValidationGroup="GrpGuardar">
|
||||
<%-- <asp:ListItem Selected="True" Text="Sin Proyecto asignado" Value="-1"></asp:ListItem>--%>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlProyectoAsignado" runat="server" InitialValue="-1" ControlToValidate="DdlProyectoAsignado" ValidationGroup="GrpGuardar" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proyecto''</b> es necesario, por favor seleccione uno."></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlProyectoAsignado.ClientID.ToString()%>">Proyecto: </label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:Label runat="server" ID="LblSubProyectoAsignado" CssClass="form-line" for="<%= DdlSubProyectoAsignado.ClientID.ToString()%>" style="margin-bottom:unset;color:#888888">SubProyecto: </asp:Label>
|
||||
<asp:DropDownList ID="DdlSubProyectoAsignado" runat="server" AppendDataBoundItems="True" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin SubProyecto asignado" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoAsignado" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyectoAsignado" ValidationGroup="GrpGuardar" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno."></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlSubProyectoAsignado.ClientID.ToString()%>">SubProyecto: </label>
|
||||
<i></i>
|
||||
</div>
|
||||
<%-- <div class="form-group form-md-line-input input-iconright">
|
||||
@@ -1523,10 +1523,10 @@
|
||||
|
||||
<asp:DropDownList ID="DdlInfoTipoAplicacion" AutoPostBack="true" runat="server" Class="form-control select2me" Width="100%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit(Movto Permanente)" Value="5000"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit(Porcentaje)" Value="5001"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit(Factor Descuento)" Value="5002"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit(Cuota Fija)" Value="5003"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit (Movto Permanente)" Value="5000"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit (Porcentaje)" Value="5001"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit (Factor Descuento)" Value="5002"></asp:ListItem>
|
||||
<asp:ListItem Text="Infonavit (Cuota Fija)" Value="5003"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1602,8 +1602,8 @@
|
||||
|
||||
<asp:DropDownList ID="DdlFonTipoAplicacion" runat="server" Class="form-control select2me" Width="100%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Fonacot(Importe fijo)" Value="3001"></asp:ListItem>
|
||||
<asp:ListItem Text="Fonacot(Por días Labarados)" Value="3002"></asp:ListItem>
|
||||
<asp:ListItem Text="Fonacot (Importe fijo)" Value="3001"></asp:ListItem>
|
||||
<asp:ListItem Text="Fonacot (Por días Laborados)" Value="3002"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3538,7 +3538,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="GvLicencias" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
|
||||
DataKeyNames="CveLicencia,Licencia,FechaExpedicion,FechaVencimiento"
|
||||
DataKeyNames="CveLicencia,Licencia,FechaExpedicion,FechaVencimiento,Estatus"
|
||||
CssClass=" table table-striped table-advance table-hover Widthall" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
@@ -4614,7 +4614,7 @@
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" runat="server" style="text-align: left">modificar Salario</h4>
|
||||
<h4 class="modal-title" runat="server" style="text-align: left">Modificar Salario</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div>
|
||||
|
||||
@@ -1041,11 +1041,13 @@ Partial Class RH_Personal
|
||||
|
||||
Private Sub CargaProyecto()
|
||||
|
||||
DdlProyectoAsignado.Items.Clear()
|
||||
DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 1)
|
||||
DdlProyectoAsignado.DataBind()
|
||||
CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyectoAsignado, LblSubProyectoAsignado)
|
||||
DivProyectosAsignado.Visible = LblProyectoAsignado.Visible
|
||||
'DdlProyectoAsignado.Items.Clear()
|
||||
'DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 1)
|
||||
'DdlProyectoAsignado.DataBind()
|
||||
|
||||
DdlProyectoAsignado.Items.Insert(0, New ListItem("Sin Proyecto asignado", "-1"))
|
||||
'DdlProyectoAsignado.Items.Insert(0, New ListItem("Sin Proyecto asignado", "-1"))
|
||||
|
||||
DdlProyectoAsistenciaC.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
|
||||
DdlProyectoAsistenciaC.DataBind()
|
||||
@@ -4671,12 +4673,17 @@ Partial Class RH_Personal
|
||||
Dim Fecha As String = DateTime.Now.ToString("dd/MM/yyyy")
|
||||
Dim Solicitante As String = UsuarioActual.Nombre
|
||||
Dim anio As Integer = GvRow.DataKey("FechaInicio").ToDate().Year
|
||||
Dim FechaPeriodo As String = GvRow.DataKey("Periodo")
|
||||
|
||||
|
||||
|
||||
|
||||
If Periodoingreso > PeriodoInicio Then
|
||||
anio = anio - 1
|
||||
End If
|
||||
|
||||
|
||||
Dim FechaPeriodo As String = String.Format("{0:dd/MM}/{1}", fechaIngreso, anio)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If File.Exists(RutaFormato) Then
|
||||
|
||||
Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
|
||||
@@ -6123,10 +6130,36 @@ Partial Class RH_Personal
|
||||
End If
|
||||
If TxtFIPrimaVacacional.Text = "0" Or TxtFIPrimaVacacional.Text = "" Or TxtFIAguinaldo.Text = "-1" Then
|
||||
TxtFIPrimaVacacional.Text = "25"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
TxtFISalariodiarioImss.Text = TxtSalarioCotizado.Text
|
||||
TxtFactordeIntegracion.Text = ""
|
||||
TxtFISalarioDiarioIntegrado.Text = ""
|
||||
TxtFISalarioDiarioIntegrado.Text = ""
|
||||
|
||||
|
||||
|
||||
Dim objRH As New ClsRH
|
||||
|
||||
If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
If objRH.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
If objRH.DtResultados.Rows.Count > 0 Then
|
||||
TxtFIDiasVacaciones.Text = objRH.DtResultados(0)("Dias").ToString
|
||||
Else
|
||||
TxtFIDiasVacaciones.Text = "6"
|
||||
End If
|
||||
Else
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
|
||||
|
||||
|
||||
RegistraScript("$('#DmodalFactordeIntegraccion').modal()")
|
||||
UpFactordeintegracion.Update()
|
||||
End Sub
|
||||
|
||||
@@ -181,7 +181,7 @@ Partial Class RH_RepPersonalInconsistencias
|
||||
|
||||
Dim ObjAF As New ClsAF()
|
||||
If ObjAF.GetLicenciasVencidas(-1, -1, UsuarioActual.CveEmpresa, Estatus:=1) Then
|
||||
GvLicencias.DataSource = ObjAF.DtResultados
|
||||
GvLicencias.DataSource = ObjAF.DtResultados.FiltraParametros("CveEstatusPersonal = 1")
|
||||
|
||||
Else
|
||||
GvLicencias.DataSource = Nothing
|
||||
|
||||
@@ -66,13 +66,31 @@ public class Tareas72 : IHttpHandler
|
||||
string JsonStringFormat = JsonString.Replace("Resultado(", "{\"Resultado\":").Replace(")", "}");
|
||||
DataSet dataSet = JsonConvert.DeserializeObject<DataSet>(JsonStringFormat);
|
||||
DataTable dataTable = dataSet.Tables["Resultado"];
|
||||
if (dataTable.Rows[0]["eventoId"].ToString() == "Hdc")
|
||||
string eventoId = dataTable.Rows[0]["eventoId"].ToString();
|
||||
if (eventoId == "Hdc" | eventoId == "HDC")
|
||||
{
|
||||
int EstatusEntregado = 3;
|
||||
|
||||
//MANDAMOS A ACTUALIZAR CON ESTATUS DE ENTREGADO
|
||||
if (ObjGenerales.UpdatePaqueteriasGuias(CvePaqueteriaGuia, -1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", ""))
|
||||
{
|
||||
#region 'DESCARGAR IMAGEN'
|
||||
string rastreo = Guia["Rastreo"].ToString();
|
||||
string uriConsultaFirma = string.Format("https://cc.paquetexpress.com.mx/ptxws/rest/api/v1/entrega/firma/{0}/@1@2@3@4@5", rastreo);
|
||||
|
||||
HttpClient ClientFirma = new HttpClient();
|
||||
HttpResponseMessage ResponseMessageFirma = ClientFirma.GetAsync(uriConsultaFirma).Result;
|
||||
string JsonStringFirma = ResponseMessageFirma.Content.ReadAsStringAsync().Result;
|
||||
string JsonStringFormatFirma = JsonStringFirma.Replace("callback(", "{\"callback\":").Replace(")", "}");
|
||||
DataSet dataSetFirma = JsonConvert.DeserializeObject<DataSet>(JsonStringFormatFirma);
|
||||
DataTable dataTableFirma = dataSetFirma.Tables["callback"];
|
||||
|
||||
string ImagenBase64 = dataTableFirma.Rows[0]["imagen"].ToString();
|
||||
byte[] ImagenByteArray = Convert.FromBase64String(ImagenBase64);
|
||||
string rutaDestino = ModExtensiones.DirectorioEmpresas + "72\\" + "Documentos\\Guias\\" + CvePaqueteriaGuia + ".jpg";
|
||||
File.WriteAllBytes(rutaDestino,ImagenByteArray);
|
||||
#endregion
|
||||
|
||||
#region 'MANDAR CORREOS'
|
||||
int CveCliente = Guia["CveCliente"].ToString().ToEntero();
|
||||
int CveVenta = Guia["CveAgrupador"].ToString().ToEntero();
|
||||
@@ -123,7 +141,7 @@ public class Tareas72 : IHttpHandler
|
||||
ObjVentas.Dispose();
|
||||
ObjVendedores.Dispose();
|
||||
ObjEmpresa.Dispose();
|
||||
return false;
|
||||
return retorno;
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user