Entrega Almacen: Bitácora de carga. Que se guarde en un xml, las series que se vayan registrando, y se puedan recuperar. En acciones, cargar bitácora

This commit is contained in:
MLopez
2022-12-14 16:18:23 -07:00
parent 3aec717773
commit 6b3ea4669a
3 changed files with 92 additions and 9 deletions

View File

@@ -48,6 +48,14 @@
Entrega Almacén (Surtir Mercancia)
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel ID="uppCargaBitacora" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<li>
<asp:LinkButton ID="HplCargaBitacora" runat="server" Visible="false" OnClick="HplCargaBitacora_Click" Style="color: #686868;"><i class="fa fa-file-load-o" style="color: #686868;"></i> Cargar Bitácora</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>

View File

@@ -268,7 +268,30 @@ Partial Class Inventarios_EntregaAlmacen
ViewState("FormaPaqueteria") = value
End Set
End Property
'Private Property IndexSeccionAlmacen As Integer
' Get
' Return CType(ViewState("IndexSeccionAlmacen"), Integer)
' End Get
' Set(value As Integer)
' ViewState("IndexSeccionAlmacen") = value
' End Set
'End Property
Private Property ArchivoBitacora As String
Get
Return CType(ViewState("ArchivoBitacora"), String)
End Get
Set(value As String)
ViewState("ArchivoBitacora") = value
End Set
End Property
Private Property ArchivoBitacoraDetalle As String
Get
Return CType(ViewState("ArchivoBitacoraDetalle"), String)
End Get
Set(value As String)
ViewState("ArchivoBitacoraDetalle") = value
End Set
End Property
#End Region
@@ -318,7 +341,10 @@ Partial Class Inventarios_EntregaAlmacen
DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
DdlAlmacen.SelectedValue = "-1"
DdlAlmacen.DataBind()
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
If UsuarioActual.CveAlmacen > 0 Then
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
RecargaporAlmacenes()
End If
DdlAlmacenTransitorio.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3)
DdlAlmacenTransitorio.DataBind()
@@ -551,6 +577,15 @@ Partial Class Inventarios_EntregaAlmacen
If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta)
ArchivoBitacoraDetalle = String.Format("{0}Temp\EntregaDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta)
If ArchivoBitacora <> "" Then
Dim Archivo = New System.IO.FileInfo(ArchivoBitacora)
If Archivo.Exists() Then
HplCargaBitacora.Visible = True
uppCargaBitacora.Update()
End If
End If
DtDatos = ObjInventario.DtResultados
If Not DtDatos.Columns.Contains("Consec") Then DtDatos.Columns.Add("Consec", GetType(Integer))
@@ -1280,6 +1315,7 @@ Partial Class Inventarios_EntregaAlmacen
Row("FechaCaducidad") = If(AplicaCaducidad, TxtFechaCaducidad.Text, MinFecha.ToShortDateString)
DtDatosDetalle.Rows.Add(Row)
ActualizaBitacora()
RegistraScript("playsonidito('beep-07.wav')", "Sonidito")
If Tipo = 1 Then
@@ -1307,11 +1343,44 @@ Partial Class Inventarios_EntregaAlmacen
End Try
DtDatosDetalle.AcceptChanges()
ActualizaBitacora()
CargaSerie()
End Sub
#End Region
#Region "Bitacora"
Private Sub ActualizaBitacora(Optional Eliminar As Boolean = False)
If Not Eliminar Then
DtDatos.TableName = "DtDatos"
DtDatosDetalle.TableName = "DtDatosDetalle"
DtDatos.WriteXml(ArchivoBitacora, XmlWriteMode.WriteSchema)
DtDatosDetalle.WriteXml(ArchivoBitacoraDetalle, XmlWriteMode.WriteSchema)
Else
File.Delete(ArchivoBitacora)
End If
End Sub
Protected Sub HplCargaBitacora_Click(sender As Object, e As EventArgs)
If IO.File.Exists(ArchivoBitacora) Then
'DtInv.Clear()
'DtDatosDetalle.Clear()
DtDatos.ReadXml(ArchivoBitacora)
If IO.File.Exists(ArchivoBitacoraDetalle) Then
Dim dtt As New DataTable
dtt.ReadXml(ArchivoBitacoraDetalle)
DtDatosDetalle = dtt
Alert("Registro(s) Recuperados", TipoMensaje.ToastInformacion)
End If
CargaGvDatos()
Else
Alert("No hay bitácora para recuperar.", TipoMensaje.ToastInformacion)
End If
End Sub
#End Region
#Region " AGREGA CON LOTE BATCH "
Private Sub CreaDtDetalleLote()
@@ -3894,7 +3963,11 @@ Partial Class Inventarios_EntregaAlmacen
RegistraScript("$('#ModalVerSugerencias').modal('hide')")
End Sub
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacen.SelectedIndexChanged
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) 'Handles DdlAlmacen.SelectedIndexChanged
RecargaporAlmacenes()
End Sub
Private Sub RecargaporAlmacenes()
If DdlAlmacen.SelectedValue <> "-1" Then
CargaGvDatos(DdlAlmacen.SelectedValue.ToEntero)
End If

View File

@@ -17,13 +17,15 @@
<li>
<asp:HyperLink ID="HlAgregarExcel" NavigateUrl="#" Visible="true" data-toggle="modal" data-target="#DivCargaExcel" runat="server"><i class='fa fa-server'></i> Cargar Excel</asp:HyperLink>
</li>
<asp:UpdatePanel ID="uppCargaBitacora" runat="server" UpdateMode="Conditional" RenderMode="Inline"><ContentTemplate>
<li>
<asp:Linkbutton ID="HplCargaBitacora" runat="server" Visible="false" OnClick="HplCargaBitacora_Click" Style="color: #686868;"><i class="fa fa-file-load-o" style="color: #686868;"></i> Cargar Bitácora</asp:Linkbutton>
<asp:UpdatePanel ID="uppCargaBitacora" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<li>
<asp:LinkButton ID="HplCargaBitacora" runat="server" Visible="false" OnClick="HplCargaBitacora_Click" Style="color: #686868;"><i class="fa fa-file-load-o" style="color: #686868;"></i> Cargar Bitácora</asp:LinkButton>
</li>
</ContentTemplate></asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Recepción Almacén