Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
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,335 @@ 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, 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" EnableEventValidation="false" %>
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasSalidas.aspx.vb" Inherits="Inventarios_EntradasSalidas" EnableEventValidation="false" %>
|
||||
|
||||
|
||||
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
|
||||
|
||||
@@ -435,6 +435,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
dt.Columns.Add("Serie", Type.GetType("System.String"))
|
||||
dt.Columns.Add("Lote", Type.GetType("System.String"))
|
||||
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
|
||||
dt.Columns.Add("AplicaCaducidad", Type.GetType("System.String"))
|
||||
|
||||
dt.Columns.Add("Observaciones")
|
||||
dt.Columns.Add("CountMovimientoEntradaDetalle")
|
||||
@@ -1146,7 +1147,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
' AgregarPS()
|
||||
'End Sub
|
||||
Protected Sub LkAgregarDetalle_Click(sender As Object, e As EventArgs) Handles LkAgregarDetalle.Click
|
||||
AgregarPS()
|
||||
If CveMovimientoDetalleEdit > 0 Then
|
||||
ActualizarPS()
|
||||
Else
|
||||
AgregarPS()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnSerieAddNew_Click(sender As Object, e As EventArgs)
|
||||
AgregarPS()
|
||||
@@ -1197,7 +1203,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then
|
||||
Valido = False
|
||||
Alert("El producto requiere Serie-Lote", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
'salida
|
||||
@@ -1256,6 +1262,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
registro.Item("Lote") = If(Lote <> "", Lote, "")
|
||||
registro.Item("FechaCaducidad") = FechaCaducidad
|
||||
registro.Item("Observaciones") = Observaciones
|
||||
registro.Item("AplicaCaducidad") = RowPS("AplicaCaducidad").ToString
|
||||
DtMovimientos.Rows.Add(registro)
|
||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
@@ -2364,14 +2371,17 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvM_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvM.RowEditing
|
||||
GvM.EditIndex = e.NewEditIndex
|
||||
Dim i As Integer = e.NewEditIndex
|
||||
GvM.EditIndex = i
|
||||
|
||||
Dim Gv As GridView = DirectCast(sender, GridView)
|
||||
Dim GvRow As GridViewRow = Gv.Rows(0)
|
||||
Dim GvRow As GridViewRow = Gv.Rows(i)
|
||||
If CveMovimiento > 0 Then
|
||||
CveMovimientoDetalleEdit = GvRow.DataKey("CveMovimientoDetalle").ToEntero
|
||||
divCantidad.Visible = False
|
||||
divClasificacionProducto.Visible = False
|
||||
divUnidadMedida.Visible = False
|
||||
txtCantidad.Enabled = False
|
||||
DdlClasificacion.Enabled = False
|
||||
DdlProducto2.Enabled = False
|
||||
DdlUnidad.Enabled = False
|
||||
End If
|
||||
txtCantidad.Text = GvRow.DataKey("Cantidad").ToEntero().ToString
|
||||
DdlProducto2.SelectedValue = GvRow.DataKey("CvePS")
|
||||
@@ -2429,30 +2439,30 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
Protected Sub GvM_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvM.RowUpdating
|
||||
|
||||
Dim Precio As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDouble
|
||||
Dim No As Integer = GvM.Rows(e.RowIndex).DataKey("No").ToEntero
|
||||
Dim serie As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerie").Text.Replace(" ", String.Empty)
|
||||
Dim Observaciones As String = GvM.Rows(e.RowIndex).FCTextBox("TxtObservaciones").Text
|
||||
Dim CveSeccionAlmacen As Integer = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
Dim SeccionAlmacen As String = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedItem.Text
|
||||
Dim Cantidad As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDouble
|
||||
Dim Drs As DataRow() = DtMovimientos.Select(String.Format("No = {0}", No))
|
||||
'Dim Precio As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDouble
|
||||
'Dim No As Integer = GvM.Rows(e.RowIndex).DataKey("No").ToEntero
|
||||
'Dim serie As String = GvM.Rows(e.RowIndex).FCTextBox("TxtSerie").Text.Replace(" ", String.Empty)
|
||||
'Dim Observaciones As String = GvM.Rows(e.RowIndex).FCTextBox("TxtObservaciones").Text
|
||||
'Dim CveSeccionAlmacen As Integer = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
'Dim SeccionAlmacen As String = GvM.Rows(e.RowIndex).FCDropDownList("DdlSeccionAlmacen").SelectedItem.Text
|
||||
'Dim Cantidad As Double = GvM.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDouble
|
||||
'Dim Drs As DataRow() = DtMovimientos.Select(String.Format("No = {0}", No))
|
||||
|
||||
If Drs.Count > 0 Then
|
||||
Drs(0)("Cantidad") = Cantidad
|
||||
Drs(0)("PU") = Precio
|
||||
Drs(0)("Total") = Drs(0)("Cantidad").ToString.ToDouble * Precio
|
||||
Drs(0)("Estatus") = "U"
|
||||
Drs(0)("Serie") = serie
|
||||
Drs(0)("Observaciones") = Observaciones
|
||||
Drs(0)("CveSeccionAlmacen") = CveSeccionAlmacen
|
||||
Drs(0)("SeccionAlmacen") = SeccionAlmacen
|
||||
End If
|
||||
'If Drs.Count > 0 Then
|
||||
' Drs(0)("Cantidad") = Cantidad
|
||||
' Drs(0)("PU") = Precio
|
||||
' Drs(0)("Total") = Drs(0)("Cantidad").ToString.ToDouble * Precio
|
||||
' Drs(0)("Estatus") = "U"
|
||||
' Drs(0)("Serie") = serie
|
||||
' Drs(0)("Observaciones") = Observaciones
|
||||
' Drs(0)("CveSeccionAlmacen") = CveSeccionAlmacen
|
||||
' Drs(0)("SeccionAlmacen") = SeccionAlmacen
|
||||
'End If
|
||||
|
||||
DtMovimientos.AcceptChanges()
|
||||
GvM.EditIndex = -1
|
||||
'DtMovimientos.AcceptChanges()
|
||||
'GvM.EditIndex = -1
|
||||
|
||||
CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
'CargaGVM(DtMovimientos.FiltraParametros("Estatus <> 'E' "))
|
||||
|
||||
End Sub
|
||||
Protected Sub DeleteRow(ByVal sender As Object, ByVal e As EventArgs)
|
||||
@@ -4301,11 +4311,14 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
|
||||
Private Sub ActualizarPS()
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDouble, DdlUnidad.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDouble, CveAFEdit,
|
||||
CveMovimientoDetalleEdit, DdlSeccionAlmacen.SelectedValue.ToEntero, TxtnSerie.Text, TxtObservacionesdetalle.Text,
|
||||
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
Alert("Error al Actualizar los movimientos")
|
||||
Else
|
||||
RegistraScript("$('#ModalAgregar').modal('hide')")
|
||||
End If
|
||||
ObjInventario.Dispose()
|
||||
End Sub
|
||||
|
||||
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" 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>
|
||||
299
OI/DocumentoDetalle.aspx.cs
Normal file
299
OI/DocumentoDetalle.aspx.cs
Normal file
@@ -0,0 +1,299 @@
|
||||
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;
|
||||
|
||||
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 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();
|
||||
}
|
||||
}
|
||||
#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";
|
||||
|
||||
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) { GuardarUsuariosQueAutorizan(CveDocumento, RutaArchivo, ref ObjOI, ref TieneError); }//asignamos a los usuarios que participaran en aprovar este documento
|
||||
|
||||
|
||||
//Gestión de errores y resultados
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjOI.Commit();
|
||||
Alert("Documento guardado correctamente");
|
||||
//this.CveDocumento = CveDocumento;
|
||||
Response.Redirect(string.Format("/OI/DocumentoDetalle.aspx?CveDocumento={0}",CveDocumento));
|
||||
}
|
||||
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 void GuardarUsuariosQueAutorizan(int CveDocumento, string RutaArchivo, ref ClsOIEventos ObjOI, ref bool TieneError)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#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
|
||||
|
||||
|
||||
}
|
||||
54
OI/Documentos.aspx
Normal file
54
OI/Documentos.aspx
Normal file
@@ -0,0 +1,54 @@
|
||||
<%@ 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>
|
||||
<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: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();
|
||||
}
|
||||
}
|
||||
@@ -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">
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user