Validación al cambiar la configuración para no afectar a los productos con los qu eya se tienen existencias
This commit is contained in:
@@ -184,7 +184,7 @@
|
|||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:DropDownList ID="DdlUnidadMedida" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="206px">
|
<asp:DropDownList ID="DdlUnidadMedida" OnSelectedIndexChanged="DdlUnidadMedida_SelectedIndexChanged" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" CausesValidation="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="206px">
|
||||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
<label for="<%= DdlUnidadMedida.ClientID.ToString()%>">Unidad de Medida:</label>
|
<label for="<%= DdlUnidadMedida.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||||
|
|||||||
@@ -106,6 +106,15 @@ Partial Class ProductosyServicios
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveUnidadMedida As Integer
|
||||||
|
Get
|
||||||
|
Return ViewState("CveUnidadMedida").ToString.ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveUnidadMedida") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -769,6 +778,7 @@ Partial Class ProductosyServicios
|
|||||||
End If
|
End If
|
||||||
DdlTipoPSDes.SelectedValueExist(ObjProductosServicios.CveClasificacionDetalle.ToString)
|
DdlTipoPSDes.SelectedValueExist(ObjProductosServicios.CveClasificacionDetalle.ToString)
|
||||||
DdlUnidadMedida.SelectedValue = ObjProductosServicios.CveUnidadMedida.ToString
|
DdlUnidadMedida.SelectedValue = ObjProductosServicios.CveUnidadMedida.ToString
|
||||||
|
CveUnidadMedida = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero
|
||||||
DdlMarca.SelectedValue = ObjProductosServicios.CveMarca.ToString
|
DdlMarca.SelectedValue = ObjProductosServicios.CveMarca.ToString
|
||||||
DdlMarcaPSDes.SelectedValue = ObjProductosServicios.CveMarca.ToString
|
DdlMarcaPSDes.SelectedValue = ObjProductosServicios.CveMarca.ToString
|
||||||
TxtCodigo.Text = ObjProductosServicios.Codigo
|
TxtCodigo.Text = ObjProductosServicios.Codigo
|
||||||
@@ -2653,23 +2663,32 @@ Partial Class ProductosyServicios
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ChkSerie_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkSerie_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
If ChkSerie.Checked Then
|
If ElProductoTieneExistencia() Then
|
||||||
ddlMetodos.SelectedValueExist("5")
|
ChkSerie.Checked = Not ChkSerie.Checked
|
||||||
|
Alert("el producto no se puede cambiar la opcion, porque tiene existencia.", TipoMensaje.MsgAdvertencia)
|
||||||
Else
|
Else
|
||||||
ddlMetodos.SelectedValueExist("-1")
|
If ChkSerie.Checked Then
|
||||||
|
ddlMetodos.SelectedValueExist("5")
|
||||||
|
Else
|
||||||
|
ddlMetodos.SelectedValueExist("-1")
|
||||||
|
End If
|
||||||
|
UpConta.Update()
|
||||||
End If
|
End If
|
||||||
UpConta.Update()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub ChkSeccion_CheckedChanged(sender As Object, e As EventArgs)
|
Protected Sub ChkSeccion_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
|
If ElProductoTieneExistencia() Then
|
||||||
If ChkSeccion.Checked Then
|
ChkSeccion.Checked = Not ChkSerie.Checked
|
||||||
DivSeccionAlmacen.Visible = True
|
Alert("el producto no se puede cambiar la opcion, porque tiene existencia.", TipoMensaje.MsgAdvertencia)
|
||||||
Else
|
Else
|
||||||
DivSeccionAlmacen.Visible = False
|
If ChkSeccion.Checked Then
|
||||||
End If
|
DivSeccionAlmacen.Visible = True
|
||||||
|
Else
|
||||||
|
DivSeccionAlmacen.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
UpSeccionAlmacen.Update()
|
UpSeccionAlmacen.Update()
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
@@ -2680,4 +2699,21 @@ Partial Class ProductosyServicios
|
|||||||
|
|
||||||
UpModalSeccionAlmacen.Update()
|
UpModalSeccionAlmacen.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub DdlUnidadMedida_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
If ElProductoTieneExistencia() Then
|
||||||
|
DdlUnidadMedida.SelectedValue = CveUnidadMedida.ToString
|
||||||
|
Alert("el producto no se puede cambiar la opcion, porque tiene existencia.")
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function ElProductoTieneExistencia() As Boolean
|
||||||
|
Dim Existencia As Decimal = 0
|
||||||
|
If CvePS > 0 Then
|
||||||
|
Dim ObjInventarios As New ClsInventarios
|
||||||
|
Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, -1)
|
||||||
|
ObjInventarios.Dispose()
|
||||||
|
End If
|
||||||
|
Return Existencia > 0
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user