Modulo Orden Produccion Detalle

This commit is contained in:
Luis Quijada
2025-03-13 09:53:23 -07:00
parent 52593271df
commit 9c42ed5ea6
5 changed files with 797 additions and 272 deletions

View File

@@ -2,6 +2,7 @@
Imports System.Data Imports System.Data
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports Microsoft.VisualBasic Imports Microsoft.VisualBasic
Imports Telerik.Web.UI.ImageEditor
Public Class ClsOP Public Class ClsOP
Implements IDisposable Implements IDisposable
@@ -112,7 +113,55 @@ Public Class ClsOP
Public Function GetProductosOP(CveOP As Integer, CveEmpresa As Integer) As Boolean Public Function GetProductosOP(CveOP As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OP_ProductosGET") DataAdapter("PA_OP_ProductosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetProductosMO(CveOP As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_ProductosMOGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetProductosMP(CveOP As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_ProductosMPGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetProductosCI(CveOP As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_ProductosCIGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP .Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -359,7 +408,7 @@ Public Class ClsOP
#Region "O R D E N E S D E P R O D U C C I O N" #Region "O R D E N E S D E P R O D U C C I O N"
Public Function GetReportesOP(CveOP As Integer, CveCliente As Integer, CveSubProyecto As Integer, CvePS As Integer, CveEstatus As Integer, Asignado As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer) As Boolean Public Function GetReportesOP(CveOP As Integer, CveCliente As Integer, CveSubProyecto As Integer, CvePS As Integer, CveEstatus As Integer, Asignado As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OP_OrdendeProduccionGet") DataAdapter("PA_OP_OrdendeProduccionGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -369,8 +418,8 @@ Public Class ClsOP
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
.Add("@Asignado", SqlDbType.Int).Value = Asignado .Add("@Asignado", SqlDbType.Int).Value = Asignado
.Add("@FechaI", SqlDbType.Date).Value = FechaInicio .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaFin .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
@@ -382,6 +431,75 @@ Public Class ClsOP
Return Retorno Return Retorno
End Function End Function
Public Function GetOP(CveOP As Integer, CveCliente As Integer, CveSubProyecto As Integer, CvePS As Integer, CveEstatus As Integer, Asignado As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_OrdendeProduccionGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
.Add("@Asignado", SqlDbType.Int).Value = Asignado
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetEstatusOP(CveEmpresa As Integer, Optional CveEstatusOP As Integer = -1, Optional TipoEstatus As Integer = -1, Optional Estatus As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_EstatusOPGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstatusOP", SqlDbType.Int).Value = CveEstatusOP
.Add("@TipoEstatus", SqlDbType.Int).Value = TipoEstatus
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los Estatus de Factura.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateOP(CveOP As Integer, Descripcion As String, CveCliente As Integer, CvePS As Integer, CveSubProyecto As Integer, Cantidad As Integer, Fecha As Date, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OP_OrdendeProduccionUp")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOP", SqlDbType.Int).Value = CveOP
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Cantidad", SqlDbType.Int).Value = Cantidad
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar la orden de producción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable

View File

@@ -403,6 +403,33 @@ Public Class ClsPaginas
Application("GlobalDTEstatus") = value Application("GlobalDTEstatus") = value
End Set End Set
End Property End Property
#Region "ordenes de producción"
Property GlobalDTOPEstatus(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTOPEstatus-{CveEmpresa}"
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjOP As New ClsOP
If ObjOP.GetEstatusOP(CveEmpresa) Then Application(AppNombre) = ObjOP.DtResultados
End Using
End If
Dim filtros As New List(Of String)
If Estatus <> -1 Then filtros.Add($"Estatus = {Estatus}")
If filtros.Count > 0 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTOPEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTOPEstatus = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTOPEstatus-{CveEmpresa}"
Application(AppNombre) = value
End Set
End Property
#End Region
Property DtFacturaDefault() As DataTable Property DtFacturaDefault() As DataTable
Get Get
DtFacturaDefault = DirectCast(Application("DtFacturaDefault"), DataTable) DtFacturaDefault = DirectCast(Application("DtFacturaDefault"), DataTable)
@@ -9892,6 +9919,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), 908) PaginaDict.Add("/OI/ConvocatoriaDetalle.aspx".ToUpper(), 908)
PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), 908) PaginaDict.Add("/OI/RepReuniones.aspx".ToUpper(), 908)
PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1) PaginaDict.Add("/AdSistemasTeam/ProcedimientosAlmacenados.aspx".ToUpper(), -1)
PaginaDict.Add("/OS/CatOrdenesServiciosCaracteristicas.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOrdenesServiciosCaracteristicas.aspx".ToUpper(), -1)
PaginaDict.Add("/OS/CatOSCaracteristicasOpciones.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatOSCaracteristicasOpciones.aspx".ToUpper(), -1)
PaginaDict.Add("/OS/CatSubTiposOrdenesServicios.aspx".ToUpper(), -1) PaginaDict.Add("/OS/CatSubTiposOrdenesServicios.aspx".ToUpper(), -1)
@@ -11125,6 +11153,8 @@ Public Class ClsPaginas
#Region "Ordenes de Produccion" #Region "Ordenes de Produccion"
PaginaDict.Add("/OP/CatConfiguracionProducto.aspx".ToUpper(), 790) PaginaDict.Add("/OP/CatConfiguracionProducto.aspx".ToUpper(), 790)
PaginaDict.Add("/OP/RepOS.aspx".ToUpper(), 791) PaginaDict.Add("/OP/RepOS.aspx".ToUpper(), 791)
PaginaDict.Add("/OP/OP.aspx".ToUpper(), -1)
PaginaDict.Add("/OP/RepOP.aspx".ToUpper(), -1)
#End Region #End Region
'Antes de aquí. 'Antes de aquí.

216
OP/RepOP.aspx Normal file
View File

@@ -0,0 +1,216 @@
<%@ Page Title="Orden de Produccion" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOP.aspx.vb" Inherits="OP_RepOP" %>
<%@ 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">
<style>
table > tbody > .SubTotales, table > tbody > .SubTotales:hover, table > tbody > .SubTotales:nth-of-type(odd) {
background: #CCCCCC !important;
}
table > tbody > .SubTotalesB, table > tbody > .SubTotalesB:hover, table > tbody > .SubTotalesB:nth-of-type(odd) {
background: #DDD !important;
}
.SegundoNivel, .SegundoNivel:hover {
background-color: rgba(172, 195, 222, 0.65) !important;
}
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
background-color: rgba(255,255,255,0.9) !important;
border: 1px solid #ced4da !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
/* Ajustar posición del botón "Consultar" */
.portlet-title .tools {
margin-top: -1px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<%-- <asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-fit-height btnopaco" />--%>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:HyperLink ID="HLAgregarOrdenOP" NavigateUrl="OP.aspx?CveOP=-1" runat="server"> <i class="fa fa-plus"></i>Agregar Orden de Producción</asp:HyperLink>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Orden de Producción
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1 ">Cliente:</label>
<div class="col-md-2">
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
<asp:Label ID="LblProyecto" runat="server" class="col-md-1">
<span class="filtro-texto">Proyecto:</span>
</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1">
<span class="filtro-texto">Subproyecto:</span>
</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;"></asp:DropDownList>
</div>
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatusOP" runat="server" AppendDataBoundItems="true" DataTextField="EstatusOP" DataValueField="CveEstatusOP" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label class="col-md-1 truncate">Productos Servicios:</label>
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
<div class="col-md-1">
<label class="mb-0">Fecha Inicio:</label>
<!-- Usa etiqueta <label> -->
</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
<label class="mb-0">Fecha Fin:</label>
</div>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" DataKeysNames="CveOP" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None" Width="99%">
<Columns>
<asp:HyperLinkField DataNavigateUrlFormatString="/OP/OP.aspx?CveOP={0}" DataNavigateUrlFields="CveOP" ControlStyle-CssClass="Texto" DataTextField="Folio" HeaderText="Folio"
ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente"
ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción"
ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha"
DataFormatString="{0:dd/MM/yyyy}"
ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus"
ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="AsignadoA" HeaderText="Asignado"
ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
</asp:Content>

161
OP/RepOP.aspx.vb Normal file
View File

@@ -0,0 +1,161 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Ionic.Zlib
Imports Microsoft.Reporting.WebForms
Partial Class OP_RepOP
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtOp As DataTable
Get
Return DirectCast(ViewState("DtOp"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtOp") = value
End Set
End Property
Private Property Agrupador As String
Get
Return ViewState("Agrupador").ToString
End Get
Set(value As String)
ViewState("Agrupador") = value
End Set
End Property
Private Property TCEspecifico As Double
Get
Return ViewState("TCEspecifico").ToString.ToDouble
End Get
Set(value As Double)
ViewState("TCEspecifico") = value
End Set
End Property
Private Property TipoCambio As Integer
Get
Return ViewState("TipoCambio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoCambio") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
'CargarMarcas()
SetValues()
End If
End Sub
#Region " CARGA DATOS INICIALES "
Private Sub SetValues()
'Carga Productos
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPS.SelectedText = ""
DdlPS.SelectedValue = "-1"
Else
DdlPS.ddl.Items.Clear()
DdlPS.ddl.DataBind()
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
'CargaEstatus
DdlEstatusOP.DataSource = GlobalDTOPEstatus(UsuarioActual.CveEmpresa)
DdlEstatusOP.DataBind()
DdlEstatusOP.Items.Add(New ListItem("Canceladas", "4"))
DdlEstatusOP.SelectedValue = "-1"
'Carga Clasificacion del cliente
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1)
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlEstatusOP.DataSource = GlobalDTOPEstatus(UsuarioActual.CveEmpresa)
DdlEstatusOP.DataBind()
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().ToShortDateString
If UsuarioActual.TienePermisoProceso(339) Then
GvDatos.Columns(3).Visible = False
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = False
GvDatos.Columns(6).Visible = False
End If
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
End Sub
Private Sub CargaDatos()
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
Dim ObjOP As New ClsOP()
If ObjOP.GetReportesOP(-1, DdlClientes.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero,
DdlPS.SelectedValue.ToEntero,
DdlEstatusOP.SelectedValue.ToEntero,
-1,
FechaI, FechaF,
UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjOP.DtResultados
DtOp = ObjOP.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjOP.Dispose()
GvDatos.DataBind()
End Sub
#End Region
#Region "Gv Datos"
Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'Verificar si el DataKey existe
If e.Row.DataItem IsNot Nothing AndAlso GvDatos.DataKeys.Count > e.Row.RowIndex Then
Dim CveOP As Integer = GvDatos.DataKeys(e.Row.RowIndex).Value.ToString().ToEntero()
Dim Liga As String = $"/OP/OP.aspx?CveOP={CveOP}"
'Acceder al control solo si existe
Dim hl As HyperLink = TryCast(e.Row.FindControl("HlAgregarOrdenOP"), HyperLink)
If hl IsNot Nothing Then
hl.NavigateUrl = Liga
End If
End If
End If
End Sub
#End Region
End Class

View File

@@ -1,20 +1,20 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RolesDetalle.aspx.vb" Inherits="Sistemas_RolesDetalle" %>  <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RolesDetalle.aspx.vb" Inherits="Sistemas_RolesDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Rol: Rol:
<asp:Label runat="server" Text="Rol" ID="LblRol"></asp:Label> <asp:Label runat="server" Text="Rol" ID="LblRol"></asp:Label>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpDatos"> <asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpDatos">
<ContentTemplate> <ContentTemplate>
@@ -311,7 +311,7 @@
</div> </div>
</div> </div>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>