- ajuste de actualizar un dato registrado
This commit is contained in:
@@ -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" %>
|
||||
|
||||
@@ -1146,7 +1146,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 +1202,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
|
||||
@@ -2364,14 +2369,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 +2437,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 +4309,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
|
||||
|
||||
Reference in New Issue
Block a user