Commit inicial Ventas Productivo
This commit is contained in:
236
OS/Asignaciones.aspx
Normal file
236
OS/Asignaciones.aspx
Normal file
@@ -0,0 +1,236 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Asignaciones.aspx.vb" Inherits="OS_Asignaciones" %>
|
||||
|
||||
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %>
|
||||
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel ID="UpnTools" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Reporte</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="ImgImprimir" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CSS" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="E" runat="Server">
|
||||
Asignación de Órdenes de Servicio
|
||||
</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">
|
||||
<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">
|
||||
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlCliente" DataTextField="Nombre" DataValueField="CveCliente" runat="server" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Centro de Costo:</label>
|
||||
<div 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">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
|
||||
<div id="DivTecnico" runat="server" visible="false">
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlPersonas" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate">F.I.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox 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>
|
||||
<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>
|
||||
<label class="col-md-1 truncate">F.F.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox 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>
|
||||
<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>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div>
|
||||
<div class="row">
|
||||
<div id="DivAsignacionPersona" class="col-md-12" runat="server">
|
||||
<asp:UpdatePanel ID="UpAsignacionPersona" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Asignación por Persona</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:GridView ID="GvA" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Usuarios con Órdenes de Servicio Asignadas"
|
||||
CssClass="table table-striped table-hover Widthall table-advance" GridLines="None">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Nombre" DataNavigateUrlFields="CveUsuarioAtendio" Target="_blank" DataNavigateUrlFormatString="~/OS/RepOrdenesServicios.aspx?CveUsuarioTecnico={0}" />
|
||||
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="DivOS" class="col-md-12" runat="server">
|
||||
<asp:UpdatePanel ID="UpOS" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light xspadding bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Ordenes Sin Asignar</span>
|
||||
|
||||
<div class="row" id="DivAsignar" runat="server" style="margin-left: 15px;">
|
||||
<asp:DropDownList ID="DdlTecnico" CssClass="form-control input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario"></asp:DropDownList>
|
||||
<asp:Button ID="BtnAsignar" CssClass="btn btn-primary" runat="server" Text="Asignar" ValidationGroup="Asignar" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<div class="row">
|
||||
<div align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvNA.ClientID) %>" style="display: inline-block; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvNA.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<%--<a href="javascript:;" class="expand"></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvNA" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron Órdenes de Servicio No Asignadas" DataKeyNames="CveOSDetalle, CveOS,CveUsuarioAtendio,TipoEstatus,EstatusOrdenServicio"
|
||||
CssClass="table table-striped table-hover Widthall table-advance" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChbxAsignar" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField DataTextField="Folio" HeaderText="Folio" ControlStyle-CssClass="Texto" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataNavigateUrlFields="CveOS" />
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Concepto" HeaderText="Concepto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="EstatusOrdenServicio" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ingreso" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Fecha Servicio
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaServicio" runat="server" Visible="false" Text='<%# Eval("FechaCita", "{0:d}")%>'> ></asp:Literal>
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 115px !important; padding: 0px;" id="DivFecha" runat="server">
|
||||
<asp:TextBox ID="FechaOS" 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>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="FechaOS" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="FechaOS" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<%--<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="FechaOS" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Asignar"></asp:RequiredFieldValidator>--%>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="FechaOS" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Asignar"></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>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Hora Servicio
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlHoraServicio" runat="server" Visible="false" Text='<%# Eval("HoraCita", "{0:t}")%>'> ></asp:Literal>
|
||||
|
||||
<cc1:TimeSelector ID="TimeSelector" runat="server" DisplaySeconds="false" DisplayButtons="false" Visible="false">
|
||||
</cc1:TimeSelector>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
231
OS/Asignaciones.aspx.vb
Normal file
231
OS/Asignaciones.aspx.vb
Normal file
@@ -0,0 +1,231 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class OS_Asignaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
CargaEstatusOS()
|
||||
CargaUsuarios()
|
||||
CargaClientes()
|
||||
CargaSubProyecto()
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(171) Then
|
||||
CargaOrdenesServiciosAsignadasXPersona()
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
Else
|
||||
DivAsignar.Visible = False
|
||||
DdlEstatusOS.SelectedValueExist(GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC"))
|
||||
DdlPersonas.SelectedValueExist(UsuarioActual.CveUsuario)
|
||||
DdlEstatusOS_SelectedIndexChanged(sender, New EventArgs)
|
||||
DdlPersonas.Enabled = False
|
||||
DivAsignacionPersona.Visible = False
|
||||
'CargaOrdenesServiciosAsignadas()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "C A R G A S "
|
||||
Private Sub CargaSubProyecto()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
DdlSubProyecto.SelectedValue = Nothing
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaUsuarios()
|
||||
DdlPersonas.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlPersonas.DataBind()
|
||||
DdlPersonas.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
DdlTecnico.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlTecnico.DataBind()
|
||||
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
Private Sub CargaOrdenesServiciosNoAsignadas()
|
||||
Dim ObjOS As New ClsOS
|
||||
|
||||
Dim FechaI, FechaF As String
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
|
||||
If ObjOS.GetOrdenesServiciosNoAsignadas(DdlCliente.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
|
||||
GvNA.DataSource = ObjOS.DtResultados
|
||||
TmpDT = ObjOS.DtResultados
|
||||
Else
|
||||
GvNA.DataSource = Nothing
|
||||
End If
|
||||
GvNA.DataBind()
|
||||
ObjOS.Dispose()
|
||||
UpOS.Update()
|
||||
End Sub
|
||||
Private Sub CargaOrdenesServiciosAsignadas()
|
||||
Dim ObjOS As New ClsOS
|
||||
|
||||
Dim FechaI, FechaF As String
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
|
||||
If ObjOS.GetOrdenesServiciosAsignadas(DdlCliente.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlPersonas.SelectedValue.ToEntero, FechaI, FechaF) Then
|
||||
GvNA.DataSource = ObjOS.DtResultados
|
||||
TmpDT = ObjOS.DtResultados
|
||||
Else
|
||||
GvNA.DataSource = Nothing
|
||||
End If
|
||||
GvNA.DataBind()
|
||||
ObjOS.Dispose()
|
||||
UpOS.Update()
|
||||
End Sub
|
||||
Private Sub CargaOrdenesServiciosAsignadasXPersona()
|
||||
Dim ObjOS As New ClsOS
|
||||
If ObjOS.GetOSAsignadas(UsuarioActual.CveEmpresa) Then
|
||||
GvA.DataSource = ObjOS.DtResultados
|
||||
If ObjOS.DtResultados.Rows.Count = 0 Then
|
||||
DivAsignacionPersona.Visible = False
|
||||
End If
|
||||
Else
|
||||
GvA.DataSource = Nothing
|
||||
DivAsignacionPersona.Visible = False
|
||||
End If
|
||||
ObjOS.Dispose()
|
||||
GvA.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaClientes()
|
||||
DdlCliente.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaEstatusOS()
|
||||
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
||||
DdlEstatusOS.DataBind()
|
||||
End Sub
|
||||
Private Sub DdlEstatusOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstatusOS.SelectedIndexChanged
|
||||
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
|
||||
If TipoEstatus.ToEntero = 1 Then
|
||||
DivTecnico.Visible = False
|
||||
Else
|
||||
DivTecnico.Visible = True
|
||||
End If
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "BTN'S"
|
||||
Protected Sub BtnAsignar_Click(sender As Object, e As EventArgs) Handles BtnAsignar.Click
|
||||
Dim ObjOS As New ClsOS
|
||||
Dim TieneError = False
|
||||
Dim CveEstatusOS = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC")
|
||||
Dim time As DateTime
|
||||
|
||||
For Each row As GridViewRow In GvNA.Rows
|
||||
If row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
Dim picker As MKB.TimePicker.TimeSelector = DirectCast(row.FindControl("TimeSelector"), MKB.TimePicker.TimeSelector)
|
||||
|
||||
If row.FCCheckBox("ChbxAsignar").Checked Then
|
||||
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, picker.AmPm))
|
||||
If Not ObjOS.UpdateOrdenesServiciosAsignadas(row.DataKey("CveOSDetalle").ToEntero, DdlTecnico.SelectedValue.ToEntero, row.FCTextBox("FechaOS").Text.ToDate, time, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
If Not ObjOS.UpdateOrdenesServiciosEstatus(CveEstatusOS.ToEntero, UsuarioActual.CveUsuario, row.DataKey("CveOS").ToEntero) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not TieneError Then
|
||||
Alert("Se asignaron las ordenes de servicio correctamente", TipoMensaje.MsgInformacion)
|
||||
CargaOrdenesServiciosAsignadasXPersona()
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
End If
|
||||
|
||||
|
||||
ObjOS.Dispose()
|
||||
UpAsignacionPersona.Update()
|
||||
UpOS.Update()
|
||||
End Sub
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", DdlEstatusOS.SelectedValue))
|
||||
|
||||
If TipoEstatus.ToEntero <= 1 Then
|
||||
CargaOrdenesServiciosNoAsignadas()
|
||||
Else
|
||||
CargaOrdenesServiciosAsignadas()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "GV"
|
||||
Private Sub GvNA_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNA.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("CveUsuarioAtendio") <> "" Then
|
||||
e.Row.FCCheckBox("ChbxAsignar").Visible = False
|
||||
e.Row.FCTextBox("FechaOS").Visible = False
|
||||
e.Row.FCLinkButton("imgCalendario").Visible = False
|
||||
e.Row.FCLiteral("LtlFechaServicio").Visible = True
|
||||
e.Row.FCLiteral("LtlHoraServicio").Visible = True
|
||||
e.Row.FindControl("TimeSelector").Visible = False
|
||||
Else
|
||||
e.Row.FCLiteral("LtlFechaServicio").Visible = False
|
||||
e.Row.FCCheckBox("ChbxAsignar").Checked = False
|
||||
e.Row.FCCheckBox("ChbxAsignar").Visible = True
|
||||
e.Row.FCTextBox("FechaOS").Visible = True
|
||||
e.Row.FCTextBox("FechaOS").Text = Now.ToString("dd/MM/yyy")
|
||||
e.Row.FCLinkButton("imgCalendario").Visible = True
|
||||
e.Row.FCLiteral("LtlHoraServicio").Visible = False
|
||||
e.Row.FindControl("TimeSelector").Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UpOS.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "IMPRIMIR PDF"
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
Dim params As New List(Of ReportParameter)
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim dt As DataTable = TmpDT
|
||||
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
|
||||
params.Add(New ReportParameter("FechaFin", txtFechaF.Text))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepOSAsignacion.rdlc", dt, params, "OrdenesServicio")
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
150
OS/CatCaracteristicasOrdenServicio.aspx.exclude
Normal file
150
OS/CatCaracteristicasOrdenServicio.aspx.exclude
Normal file
@@ -0,0 +1,150 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCaracteristicasOrdenServicio.aspx.vb" Inherits="OS_CatCaracteristicasOrdenServicio" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
|
||||
Catálogo de Características de Ordenes de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar la Característica de Orden de Servicio?');
|
||||
}
|
||||
</script>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table border="1" rules="all" style="border-collapse: collapse;">
|
||||
<tr class="Titulos">
|
||||
<td width="100px"><asp:LinkButton ID="LbTipoOrdenServicio" runat="server" CausesValidation="false" Text="Tipo de Orden de Servicio"></asp:LinkButton> <asp:ImageButton ID="ImgTipoOrdenServicio" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="150px"><asp:LinkButton ID="LbCaracteristica" runat="server" CausesValidation="false" Text="Caracteristica"></asp:LinkButton> <asp:ImageButton ID="ImgCaracteristica" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="100px"><asp:LinkButton ID="LbEsOpcion" runat="server" CausesValidation="false" Text="Es Opción"></asp:LinkButton> <asp:ImageButton ID="ImgEsOpcion" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="100px"><asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton> <asp:ImageButton ID="ImgEstatus" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="100px"><asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton> <asp:ImageButton ID="ImgFechaIng" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="100px"><asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton> <asp:ImageButton ID="ImgUsuario" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
|
||||
<td width="100">Comandos</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoOrdenServicio" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="TipoOrdenServicio" DataValueField="CveTipoOrdenServicio" Width="100px" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoOrdenServicio" runat="server" ControlToValidate="DdlTipoOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden de Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOTipoOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOrdenServicio" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="145px"></asp:TextBox>
|
||||
</td>
|
||||
<td align="center">
|
||||
<asp:CheckBox ID="ChkEsOpcion" runat="server"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaOrdenServicio" EmptyDataText="No se encontraron Características de Orden Servicios Registrados" ToolTip="Listado de Características de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoOrdenServicio" runat="server" Text='<%# Eval("TipoOrdenServicio", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlTipoOrdenServicioEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="TipoOrdenServicio" DataValueField="CveTipoOrdenServicio" Width="100px" ValidationGroup="GrpGuardar">
|
||||
</asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", " {0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCaracteristicaEditar" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' ValidationGroup="GrpEditGuardar" Width="100px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCaracteristicaEditar" runat="server" ControlToValidate="TxtCaracteristicaEditar" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaEditar" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaEditar" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- <asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtCaracteristica" runat="server" Text='<%# Eval("Caracteristica") %>' CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="145px"></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField> --%>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEsOpcion" runat="server" Text='<%# Eval("EsOpcion") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEsOpcionEdit" runat="server" Checked='<%# If (Eval("EsOpcion").ToString = "Sí", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
|
||||
<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
|
||||
<ProgressTemplate>
|
||||
<div id="overlay">
|
||||
<div id="modalprogress">
|
||||
<div id="theprogress">
|
||||
<center>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>La información se está procesando...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</asp:Content>
|
||||
|
||||
221
OS/CatCaracteristicasOrdenServicio.aspx.vb.exclude
Normal file
221
OS/CatCaracteristicasOrdenServicio.aspx.vb.exclude
Normal file
@@ -0,0 +1,221 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_CatCaracteristicasOrdenServicio
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
ViewState("OTipoOrdenServicio") = "TipoOrdenServicio DESC"
|
||||
ViewState("OCaracteristica") = "Caracteristica DESC"
|
||||
ViewState("OEstatus") = "Estatus DESC"
|
||||
ViewState("OFechaIng") = "FechaIng DESC"
|
||||
ViewState("OUsuario") = "Usuario DESC"
|
||||
CargaTipoOrdenServicio()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjCaracteristicasOrdenServicio As New ClsOS
|
||||
If ObjCaracteristicasOrdenServicio.GetCaracteristicasOrdenServicio() Then
|
||||
ViewState("DTCaracteristicasOrdenServicios") = ObjCaracteristicasOrdenServicio.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCaracteristicasOrdenServicios = ObjCaracteristicasOrdenServicio.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjCaracteristicasOrdenServicio As New ClsOS
|
||||
If ObjCaracteristicasOrdenServicio.AddCaracteristicasOrdenServicio(DdlTipoOrdenServicio.SelectedValue.ToEntero, TxtCaracteristica.Text.Trim, ChkEsOpcion.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtCaracteristica.Text = ""
|
||||
DdlTipoOrdenServicio.SelectedIndex = 0
|
||||
ChkEsOpcion.Checked = False
|
||||
Alert("La Nueva Característica de Orden de Servicio se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTCaracteristicasOrdenServicios") = ObjCaracteristicasOrdenServicio.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCaracteristicasOrdenServicios = ObjCaracteristicasOrdenServicio.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjCaracteristicasOrdenServicio.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbTipoOrdenServicio_Click(sender As Object, e As System.EventArgs) Handles LbTipoOrdenServicio.Click, ImgTipoOrdenServicio.Click
|
||||
If ViewState("OTipoOrdenServicio").ToString() = "TipoOrdenServicio DESC" Then
|
||||
ViewState("OTipoOrdenServicio") = "TipoOrdenServicio ASC"
|
||||
ImgTipoOrdenServicio.ImageUrl = "/Imagenes/FlechasArriba.gif"
|
||||
Else
|
||||
ViewState("OTipoOrdenServicio") = "TipoOrdenServicio DESC"
|
||||
ImgTipoOrdenServicio.ImageUrl = "/Imagenes/FlechasAbajo.gif"
|
||||
End If
|
||||
ViewState("Orden") = ViewState("OTipoOrdenServicio")
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub LbEstatus_Click(sender As Object, e As System.EventArgs) Handles LbEstatus.Click, ImgEstatus.Click
|
||||
If ViewState("OEstatus").ToString() = "Estatus DESC" Then
|
||||
ViewState("OEstatus") = "Estatus ASC"
|
||||
ImgEstatus.ImageUrl = "/Imagenes/FlechasArriba.gif"
|
||||
Else
|
||||
ViewState("OEstatus") = "Estatus DESC"
|
||||
ImgEstatus.ImageUrl = "/Imagenes/FlechasAbajo.gif"
|
||||
End If
|
||||
ViewState("Orden") = ViewState("OEstatus")
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub LbFechaIng_Click(sender As Object, e As System.EventArgs) Handles LbFechaIng.Click, ImgFechaIng.Click
|
||||
|
||||
If ViewState("OFechaIng").ToString() = "FechaIng DESC" Then
|
||||
ViewState("OFechaIng") = "FechaIng ASC"
|
||||
ImgFechaIng.ImageUrl = "/Imagenes/FlechasArriba.gif"
|
||||
Else
|
||||
ViewState("OFechaIng") = "FechaIng DESC"
|
||||
ImgFechaIng.ImageUrl = "/Imagenes/FlechasAbajo.gif"
|
||||
End If
|
||||
ViewState("Orden") = ViewState("OFechaIng")
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub LbUsuario_Click(sender As Object, e As System.EventArgs) Handles LbUsuario.Click, ImgUsuario.Click
|
||||
If ViewState("OUsuario").ToString() = "Usuario DESC" Then
|
||||
ViewState("OUsuario") = "Usuario ASC"
|
||||
ImgUsuario.ImageUrl = "/Imagenes/FlechasArriba.gif"
|
||||
Else
|
||||
ViewState("OUsuario") = "Usuario DESC"
|
||||
ImgUsuario.ImageUrl = "/Imagenes/FlechasAbajo.gif"
|
||||
End If
|
||||
ViewState("Orden") = ViewState("OUsuario")
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(6).Width = Unit.Pixel(48)
|
||||
'e.Row.Cells(8).Width = Unit.Pixel(48)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlTipoOrdenServicioEdit").DataSource = GlobalDTTipoOrdenServicios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlTipoOrdenServicioEdit").DataBind()
|
||||
e.Row.FCDropDownList("DdlTipoOrdenServicioEdit").SelectedValue = e.Row.DBCampo("CveTipoOrdenServicio")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjCaracteristicasOrdenServicio As New ClsOS
|
||||
If ObjCaracteristicasOrdenServicio.RemoveCaracteristicasOrdenServicio(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTCaracteristicasOrdenServicios") = ObjCaracteristicasOrdenServicio.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCaracteristicasOrdenServicios = ObjCaracteristicasOrdenServicio.DtResultados
|
||||
Alert("La Característica de Orden de Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCaracteristicasOrdenServicio.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
|
||||
Dim ObjCaracteristicasOrdenServicio As New ClsOS
|
||||
|
||||
Dim CveTipoOrdenServicio As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoOrdenServicioEdit"), DropDownList).SelectedValue.ToEntero
|
||||
Dim CveCaracteristicaOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
Dim Caracteristica As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCaracteristicaEditar"), TextBox).Text.Trim
|
||||
Dim EsOpcion As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsOpcionEdit").Checked
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
CargaTipoOrdenServicio()
|
||||
|
||||
|
||||
If ObjCaracteristicasOrdenServicio.UpdateCaracteristicasOrdenServicio(CveTipoOrdenServicio, Caracteristica, EsOpcion, Estatus, CveCaracteristicaOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTCaracteristicasOrdenServicios") = ObjCaracteristicasOrdenServicio.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTCaracteristicasOrdenServicios = ObjCaracteristicasOrdenServicio.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjCaracteristicasOrdenServicio.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTCaracteristicasOrdenServicios"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTCaracteristicasOrdenServicios"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoOrdenServicio()
|
||||
'DdlTipoOrdenServicio.Items.Clear()
|
||||
DdlTipoOrdenServicio.DataSource = GlobalDTTipoOrdenServicios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) '.FiltraParametros("CveTipoOrdenServicio = '" & DdlTipoOrdenServicio.SelectedValue & "'")
|
||||
'DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND CveTipoActivoFijo = '" & DdlTipoActivoFijo.SelectedValue & "'")
|
||||
DdlTipoOrdenServicio.DataBind()
|
||||
'DdlTipoOrdenServicio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
209
OS/CatEstatusOrdenServicio.aspx
Normal file
209
OS/CatEstatusOrdenServicio.aspx
Normal file
@@ -0,0 +1,209 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEstatusOrdenServicio.aspx.vb" Inherits="OS_CatEstatusOrdenServicio" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Widthall {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner {
|
||||
width: 100% !important;
|
||||
background-color: #dddddd;
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollFoot {
|
||||
display: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.table-scrollable {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scroll {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.table.dataTable {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
|
||||
.sinlink td a {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: black;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.white a {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.btn-verde {
|
||||
color: #32c5d2;
|
||||
background-color: #fff;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde .fa-plus {
|
||||
color: #32c5d2 !important;
|
||||
}
|
||||
|
||||
.btn-verde:hover {
|
||||
color: #fff;
|
||||
background-color: #32c5d2;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde:hover .fa-plus {
|
||||
color: white !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Estado de Orden de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UPAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarEstatus" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Estado de Orden de Servicio" Text="<i class='fa fa-plus'></i> Agregar"></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:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveEstatus" Value="-1" />
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEstatusOrdenServicio,TipoEstatus,TipoEstatusTexto,EstatusOrdenServicio,EstatusBool,Estado" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="EstatusOrdenServicio" HeaderText="Estatus Orden Servicio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoEstatusTexto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></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>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddEstatusOS" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddEstatus" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Estados de Orden de Servicio</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatusOS" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEstatusOS" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Impuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtEstatusOS.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoEstatus" runat="server" CssClass="form-control select2me js-Impuesto-programmatic" Width="100%">
|
||||
<asp:ListItem Value="1" Text="Inicial"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Proceso"></asp:ListItem>
|
||||
<asp:ListItem Value="3" Text="Terminada"></asp:ListItem>
|
||||
<asp:ListItem Value="4" Text="Cancelada"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlTipoEstatus.ClientID.ToString()%>">Tipo Estatus:</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarEstatusOS" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#divAddImpuestoLocal').modal();
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
|
||||
function SetObjects(Clasificacion) {
|
||||
debugger;
|
||||
document.getElementById(TxtEstatusOS).value = Clasificacion;
|
||||
}
|
||||
|
||||
function SetValue(Hidden, Value) {
|
||||
document.getElementById(Hidden).value = Value;
|
||||
}
|
||||
|
||||
function LimpiaModal() {
|
||||
$('#<%= TxtEstatusOS.ClientID %>').val('');
|
||||
$('#<%= ChkEstatus.ClientID %>').prop("checked", false);
|
||||
|
||||
var $example = $(".js-Impuesto-programmatic").select2();
|
||||
$example.val('1').trigger("change");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
157
OS/CatEstatusOrdenServicio.aspx.vb
Normal file
157
OS/CatEstatusOrdenServicio.aspx.vb
Normal file
@@ -0,0 +1,157 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_CatEstatusOrdenServicio
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES"
|
||||
Private Property DtEstatusOS As Data.DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtEstatusOS"), DataTable)
|
||||
End Get
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DtEstatusOS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveEstatuOS As Integer
|
||||
Get
|
||||
Return ViewState("CveEstatuOS").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEstatuOS") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CveEstatuOS = -1
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjEstatusOrdenServicios As New ClsOS
|
||||
|
||||
If ObjEstatusOrdenServicios.GetEstatusOrdenServicio() Then
|
||||
|
||||
DtEstatusOS = ObjEstatusOrdenServicios.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
GvDatos.DataSource = DtEstatusOS
|
||||
|
||||
GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa) = ObjEstatusOrdenServicios.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
OrdenaDatos()
|
||||
ObjEstatusOrdenServicios.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarEstatus_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatus.Click
|
||||
BtnAgregarEstatusOS.Text = "Agregar"
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAddEstatusOS').modal();LimpiaModal()")
|
||||
End Sub
|
||||
Private Sub BtnAgregarEstatusOS_Click(sender As Object, e As EventArgs) Handles BtnAgregarEstatusOS.Click
|
||||
Dim ObjEstatusOrdenServicios As New ClsOS
|
||||
Dim TieneError = False
|
||||
|
||||
If HdnModalidad.Value = "I" Then
|
||||
If ObjEstatusOrdenServicios.AddEstatusOrdenServicio(TxtEstatusOS.Text.Trim, DdlTipoEstatus.SelectedValue.ToEntero, If(ChkEstatus.Checked, 1, 0), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
CargaDatos()
|
||||
End If
|
||||
Else
|
||||
If HdnID.Value.ToEntero <> -1 Then
|
||||
If Not ObjEstatusOrdenServicios.UpdateEstatusOrdenServicio(TxtEstatusOS.Text.Trim, DdlTipoEstatus.SelectedValue.ToEntero, If(ChkEstatus.Checked, 1, 0), HdnID.Value.ToEntero) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
GvDatos.EditIndex = -1
|
||||
CargaDatos()
|
||||
Else
|
||||
Alert("Ocurrio un error al actualizar los datos", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ObjEstatusOrdenServicios.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
RegistraScript("$('#divAddEstatusOS').modal('hide');")
|
||||
End Sub
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
DdlTipoEstatus.SelectedValueExist(GvRow.DataKey("TipoEstatus"))
|
||||
TxtEstatusOS.Text = GvRow.DataKey("EstatusOrdenServicio")
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estado").ToString = "Activo", True, False)
|
||||
CveEstatuOS = GvRow.DataKey("CveEstatusOrdenServicio").ToEntero
|
||||
BtnAgregarEstatusOS.Text = "Actualizar"
|
||||
UpAddEstatus.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "divAddEstatusOS"))
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim URL As String = String.Format("javascript:LimpiaModal();SetValue('HdnModalidad', 'U');SetValue('HdnID', '{0}'); SetObjects('{1}');ShowDivRegistro();return false;", e.Row.DBCampo("CveEstatusOrdenServicio").ToEntero, e.Row.DBCampo("EstatusOrdenServicio"))
|
||||
'GeneroLigas
|
||||
Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").OnClientClick = URL
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjEstatusOrdenServicios As New ClsOS
|
||||
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEstatusOrdenServicio").ToEntero
|
||||
|
||||
If ObjEstatusOrdenServicios.RemoveEstatusOrdenServicio(CveEstatusOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
DtEstatusOS = ObjEstatusOrdenServicios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa) = ObjEstatusOrdenServicios.DtResultados
|
||||
Alert("El Estatus de Orden de Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjEstatusOrdenServicios.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjEstatusOrdenServicios As New ClsOS
|
||||
Dim EstatusOrdenServicio As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEstatusOrdenServicio"), TextBox).Text.Trim
|
||||
Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
'If ObjEstatusOrdenServicios.UpdateEstatusOrdenServicio(EstatusOrdenServicio, Estado, CveEstatusOrdenServicio) Then
|
||||
' GvDatos.EditIndex = -1
|
||||
' ViewState("DTEstatusOrdenServicios") = ObjEstatusOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
' GlobalDTEstatusOrdenServicios = ObjEstatusOrdenServicios.DtResultados
|
||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
'End If
|
||||
|
||||
ObjEstatusOrdenServicios.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvDatos.Rows.Count > 0) Then
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
57
OS/CatOrdenesServicios.aspx
Normal file
57
OS/CatOrdenesServicios.aspx
Normal file
@@ -0,0 +1,57 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatOrdenesServicios.aspx.vb" Inherits="OS_CatOrdenesServicios" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HB" runat="Server">
|
||||
<img alt="Nueva Orden de Servicio" onclick="document.location.href='/OS/OrdenesServicios.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Ordenes de Servicios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content9" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="80px">
|
||||
<asp:LinkButton ID="LbCveOS" runat="server" CausesValidation="false" Text="" CommandArgument="CveOS" OnClick="LbOrden_Click">
|
||||
Clave OS
|
||||
<asp:Literal ID="ImgCveOS" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="150px">
|
||||
<asp:LinkButton ID="LbCliente" runat="server" CausesValidation="false" Text="" CommandArgument="Cliente" OnClick="LbOrden_Click">
|
||||
Cliente
|
||||
<asp:Literal ID="ImgCliente" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se Encontró Orden de Servicio Registrada" ToolTip="Listado de Ordenes de servicio" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCveOS" runat="server" Text='<%# Eval("CveOS")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Cliente") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content10" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
85
OS/CatOrdenesServicios.aspx.vb
Normal file
85
OS/CatOrdenesServicios.aspx.vb
Normal file
@@ -0,0 +1,85 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_CatOrdenesServicios
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjOS As New ClsOS
|
||||
If ObjOS.GetOrdenesServicios(-1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTOS") = ObjOS.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjOS.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
End If
|
||||
'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.FCLiteral("LtlCveOS").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlCveOS").Text & "</a>"
|
||||
'e.Row.FCLiteral("LtlCliente").Text = "<a class=""Texto"" href=""/RH/Personal.aspx?CvePersonal=" & e.Row.DBCampo("CvePersonal") & """>" & e.Row.FCLiteral("LtlCliente").Text & "</a>"
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTOS"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTOS"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
107
OS/CatTipoCuentasEquipos.aspx
Normal file
107
OS/CatTipoCuentasEquipos.aspx
Normal file
@@ -0,0 +1,107 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoCuentasEquipos.aspx.vb" Inherits="OS_CatTipoCuentasEquipos" %>
|
||||
|
||||
<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 Tipos de Cuentas y/o Equipos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UPAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnAgregarTipoCuenta" runat="server" data-toggle="tooltip" data-placement="left" title="Agregar Tipo Cuenta Equip" Text="<i class='fa fa-plus'></i> Agregar"></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:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveEstatus" Value="-1" />
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveTipoCuentaEquipo,TipoCuentaEquipo,Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="TipoCuentaEquipo" HeaderText="TipoCuentaEquipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="Edit_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- MODAL AGREGAR TIPO CUENTA EQUIPO --%>
|
||||
<div id="DivAgregarTipoCuenta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregarCuenta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel3">Agregar Tipo Cuenta Equipo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyAgregarCuenta" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div id="DivAgregarCuentaDetalle" class="col-md-6" runat="server">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTipoCuentaEquipo" CssClass="form-control " runat="server" CausesValidation="true" ValidationGroup="GrpCuenta"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxtTipoCuentaEquipo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Cuenta Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpCuenta"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTipoCuentaEquipo.ClientID.ToString()%>">Identificador:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server" visible="false">
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterCuenta" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnGuardarCuenta" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpCuenta"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%-- FIN MODAL AGREGAR TIPO CUENTA --%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
function LimpiaModal() {
|
||||
$('#<%= TxtTipoCuentaEquipo.ClientID %>').val('');
|
||||
$('#<%= ChkEstatus.ClientID %>').prop("checked", false);
|
||||
}
|
||||
|
||||
function ShowDivRegistro() {
|
||||
$('#DivAgregarTipoCuenta').modal();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
99
OS/CatTipoCuentasEquipos.aspx.vb
Normal file
99
OS/CatTipoCuentasEquipos.aspx.vb
Normal file
@@ -0,0 +1,99 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_CatTipoCuentasEquipos
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property CveTipoCuentaEquipo As Integer
|
||||
Get
|
||||
Return ViewState("CveTipoCuentaEquipo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveTipoCuentaEquipo") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaTipoCuentas()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoCuentas()
|
||||
Dim ObjGenerales As New ClsGenerales
|
||||
|
||||
If ObjGenerales.GetTipoCuentasEquipos() Then
|
||||
GvDatos.DataSource = ObjGenerales.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
|
||||
End If
|
||||
|
||||
GvDatos.DataBind()
|
||||
ObjGenerales.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Private Sub BtnAgregarTipoCuenta_Click(sender As Object, e As EventArgs) Handles BtnAgregarTipoCuenta.Click
|
||||
BtnGuardarCuenta.Text = "Agregar"
|
||||
HdnModalidad.Value = "I"
|
||||
UpFooterCuenta.Update()
|
||||
RegistraScript("$('#DivAgregarTipoCuenta').modal();LimpiaModal()")
|
||||
End Sub
|
||||
Private Sub BtnGuardarCuenta_Click(sender As Object, e As EventArgs) Handles BtnGuardarCuenta.Click
|
||||
Dim ObjGenerales As New ClsGenerales
|
||||
Dim TieneError = False
|
||||
|
||||
If HdnModalidad.Value = "I" Then
|
||||
If Not ObjGenerales.AddTipoCuentaEquipo(TxtTipoCuentaEquipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
|
||||
If CveTipoCuentaEquipo <> -1 Then
|
||||
If Not ObjGenerales.UpdateTipoCuentaEquipo(TxtTipoCuentaEquipo.Text.Trim, If(ChkEstatus.Checked, True, False), CveTipoCuentaEquipo) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not TieneError Then
|
||||
GvDatos.EditIndex = -1
|
||||
CargaTipoCuentas()
|
||||
Else
|
||||
Alert("Ocurrio un error al actualizar los datos", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjGenerales.Dispose()
|
||||
UpDatos.Update()
|
||||
RegistraScript("$('#DivAgregarTipoCuenta').modal('hide');")
|
||||
End Sub
|
||||
|
||||
#Region "GV DATOS"
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
TxtTipoCuentaEquipo.Text = GvRow.DataKey("TipoCuentaEquipo")
|
||||
ChkEstatus.Checked = If(GvRow.DataKey("Estatus").ToString = "Activo", True, False)
|
||||
DivEstatus.Visible = True
|
||||
CveTipoCuentaEquipo = GvRow.DataKey("CveTipoCuentaEquipo").ToEntero
|
||||
BtnGuardarCuenta.Text = "Actualizar"
|
||||
UpAgregarCuenta.Update()
|
||||
UpDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTipoCuenta"))
|
||||
End Sub
|
||||
Private Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjGenerales As New ClsGenerales
|
||||
|
||||
Dim CveTipoCuentaEquipo As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveTipoCuentaEquipo").ToEntero
|
||||
|
||||
If ObjGenerales.RemoveTipoCuentaEquipo(CveTipoCuentaEquipo) Then
|
||||
GvDatos.EditIndex = -1
|
||||
Alert("El Tipo cuenta equipo eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
CargaTipoCuentas()
|
||||
ObjGenerales.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
118
OS/CatTiposOrdenesServicios.aspx
Normal file
118
OS/CatTiposOrdenesServicios.aspx
Normal file
@@ -0,0 +1,118 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTiposOrdenesServicios.aspx.vb" Inherits="OS_CatTiposOrdenesServicios" %>
|
||||
|
||||
<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 Tipos de Ordenes de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="250px">
|
||||
<asp:LinkButton ID="LbTipoOrdenServicio" runat="server" CausesValidation="false" Text="" CommandArgument="TipoOrdenServicio" OnClick="LbOrden_Click">
|
||||
Tipo de Orden de Servicio
|
||||
<asp:Literal ID="ImgTipoOrdenServicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
|
||||
Estatus
|
||||
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
|
||||
Fecha Ing.
|
||||
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="100px">
|
||||
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
|
||||
Usuario
|
||||
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton>
|
||||
</th>
|
||||
<th width="161px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td style="text-align: center">
|
||||
<asp:TextBox ID="TxtTipoOrdenServicio" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoOrdenServicio" runat="server" ControlToValidate="TxtTipoOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden de Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTipoOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOrdenServicio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="text-align: center">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOrdenServicioTipo" EmptyDataText="No se encontraron Tipos de Orden Servicios Registrados" ToolTip="Listado de Tipos de Ordenes de Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoOrdenServicio" runat="server" Text='<%# Eval("OrdenServicioTipo", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TxtTipoOrdenServicio" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("OrdenServicioTipo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoOrdenServicio" runat="server" ControlToValidate="TxtTipoOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Orden de Servicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCTipoOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoOrdenServicio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
184
OS/CatTiposOrdenesServicios.aspx.vb
Normal file
184
OS/CatTiposOrdenesServicios.aspx.vb
Normal file
@@ -0,0 +1,184 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_CatTiposOrdenesServicios
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property PuedeEditar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PuedeEliminar As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("PuedeEditar"))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("PuedeEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjSubTipoOrdenServicios As New ClsOS
|
||||
If ObjSubTipoOrdenServicios.GetTipoOrdenesServicios(-1) Then
|
||||
ViewState("DTTipoOrdenServicios") = ObjSubTipoOrdenServicios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTSubTipoOrdenServicios = ObjSubTipoOrdenServicios.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjSubTipoOrdenServicios.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjTipoOrdenServicios As New ClsOS
|
||||
If ObjTipoOrdenServicios.AddTipoOrdenServicio(TxtTipoOrdenServicio.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtTipoOrdenServicio.Text = ""
|
||||
Alert("El nuevo Tipo de Orden de Servicio se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjTipoOrdenServicios.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(250)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(61)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim ObjTipoOrdenServicios As New ClsOS
|
||||
If ObjTipoOrdenServicios.RemoveTipoOrdenServicio(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados
|
||||
Alert("El Tipo de Orden de Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjTipoOrdenServicios.Dispose()
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
|
||||
GvDatos.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
|
||||
Dim ObjTipoOrdenServicios As New ClsOS
|
||||
Dim TipoOrdenServicio As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtTipoOrdenServicio"), TextBox).Text.Trim
|
||||
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
|
||||
Dim CveTipoOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If ObjTipoOrdenServicios.UpdateTipoOrdenServicio(TipoOrdenServicio, False, Estatus, CveTipoOrdenServicio) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTTipoOrdenServicios") = ObjTipoOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
'GlobalDTTipoOrdenServicios(-1) = ObjTipoOrdenServicios.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjTipoOrdenServicios.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
|
||||
GvDatos.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
Dim DV As New DataView(CType(ViewState("DTTipoOrdenServicios"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
DV.Dispose()
|
||||
Else
|
||||
GvDatos.DataSource = CType(ViewState("DTTipoOrdenServicios"), DataTable)
|
||||
End If
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
1237
OS/OrdenesServicios.aspx
Normal file
1237
OS/OrdenesServicios.aspx
Normal file
File diff suppressed because it is too large
Load Diff
2616
OS/OrdenesServicios.aspx.vb
Normal file
2616
OS/OrdenesServicios.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
203
OS/PopUpBuscarCuentasEquipos.aspx
Normal file
203
OS/PopUpBuscarCuentasEquipos.aspx
Normal file
@@ -0,0 +1,203 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarCuentasEquipos.aspx.vb" Inherits="OS_PopUpBuscarCuentasEquipos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Widthall {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner {
|
||||
width: 100% !important;
|
||||
background-color: #dddddd;
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollFoot {
|
||||
display: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.table-scrollable {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scroll {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.table.dataTable {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
|
||||
.sinlink td a {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: black;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.white a {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.btn-verde {
|
||||
color: #32c5d2;
|
||||
background-color: #fff;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde .fa-plus {
|
||||
color: #32c5d2 !important;
|
||||
}
|
||||
|
||||
.btn-verde:hover {
|
||||
color: #fff;
|
||||
background-color: #32c5d2;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde:hover .fa-plus {
|
||||
color: white !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Buesqueda de Cuentas y/o Equipos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="hdnClientIDLink" runat="server" ClientIDMode="Static" />
|
||||
|
||||
<asp:UpdatePanel ID="UpCuentasEquipos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnRefreshCuentasEquipos" runat="server" ClientIDMode="Static" Style="display: none" />
|
||||
|
||||
<asp:GridView ID="GvCuentasEquipos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCuentaEquipo" EmptyDataText="No se encontraron Cuentas y/o Equipos registrados" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="ID" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LbIdentificador" CssClass="Texto" CommandName="Seleccionar" CommandArgument='<%# Eval("CveCuentaEquipo") %>' runat="server"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Tipo" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LbTipoCuentaEquipo" CssClass="Texto" CommandName="Seleccionar" CommandArgument='<%# Eval("CveCuentaEquipo") %>' runat="server"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="NoSerie" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LbNoSerie" CssClass="Texto" CommandName="Seleccionar" CommandArgument='<%# Eval("CveCuentaEquipo") %>' runat="server"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LbEstatus" CssClass="Texto" CommandName="Seleccionar" CommandArgument='<%# Eval("CveCuentaEquipo") %>' runat="server"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4">
|
||||
<asp:Button ID="BtnRegistrar" runat="server" Text="Registrar Nuevo" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosCuenta" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="Widthall">
|
||||
<tr>
|
||||
<td class="Titulos" colspan="4">Datos de la Cuenta y/o Equipo:</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Identificador:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtIdentificador" runat="server" Width="200px"></asp:TextBox></td>
|
||||
<td class="text-right"><b>Estatus:</b></td>
|
||||
<td>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" Checked="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>No.Serie:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtNoSerie" runat="server" Width="200px"></asp:TextBox></td>
|
||||
<td class="text-right"><b>Fecha Ingreso:</b></td>
|
||||
<td>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server"></asp:Literal>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td class="text-right"><b>Tipo:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlTipoCuentasEquipos" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="TipoCuentaEquipo" DataValueField="CveTipoCuentaEquipo" Class="table-group-action-input form-control input-inline input-sm" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
<asp:HiddenField runat="server" ID="hdnTipoCuentasEquipos" Value="0" />
|
||||
<asp:RequiredFieldValidator ID="RFVTipoCuentaEquipo" runat="server" ControlToValidate="DdlTipoCuentasEquipos" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETipoCuentaEquipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoCuentaEquipo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td class="text-right"><b>Usuario:</b></td>
|
||||
<td>
|
||||
<asp:Literal ID="LtlUsuario" runat="server"></asp:Literal>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="4">
|
||||
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function CargaCuentaEquipo(CveCuentaEquipo) {
|
||||
var ClientIDLink = document.getElementById("hdnClientIDLink").value;
|
||||
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
parent.CargaCuentaEquipo(CveCuentaEquipo, ClientIDLink);
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
window.opener.CargaCuentaEquipo(CveCuentaEquipo, ClientIDLink);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvCuentasEquipos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvCuentasEquipos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
95
OS/PopUpBuscarCuentasEquipos.aspx.vb
Normal file
95
OS/PopUpBuscarCuentasEquipos.aspx.vb
Normal file
@@ -0,0 +1,95 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_PopUpBuscarCuentasEquipos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 500
|
||||
RegistraScript("$get('tdContenido').style.height='350px'")
|
||||
|
||||
If Not Request("CveCliente") Is Nothing AndAlso Request("CveCliente").ToEntero > 0 Then
|
||||
CargarCuentasEquipos(Request("CveCliente").ToEntero)
|
||||
End If
|
||||
|
||||
If Not Request("EsThickbox") Is Nothing Then
|
||||
hdnEsThickbox.Value = Request("EsThickbox")
|
||||
Else
|
||||
hdnEsThickbox.Value = "N"
|
||||
End If
|
||||
|
||||
If Not Request("ClientIDLink") Is Nothing Then
|
||||
hdnClientIDLink.Value = Request("ClientIDLink")
|
||||
Else
|
||||
hdnClientIDLink.Value = "NoDefinido"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CargarCuentasEquipos(CveCliente As Integer)
|
||||
Dim ObjCuentasEquipos As New ClsGenerales
|
||||
|
||||
If ObjCuentasEquipos.GetCuentasEquipos(CveCliente, -1) Then
|
||||
GvCuentasEquipos.DataSource = ObjCuentasEquipos.DtResultados
|
||||
GvCuentasEquipos.DataBind()
|
||||
End If
|
||||
OrdenaDatos()
|
||||
ObjCuentasEquipos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvCuentasEquipos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvCuentasEquipos.RowCommand
|
||||
If e.CommandName = "Seleccionar" Then
|
||||
Dim CveCuentaEquipo As Integer = e.CommandArgument.ToString.ToEntero
|
||||
|
||||
RegistraScript("CargaCuentaEquipo(" & CveCuentaEquipo.ToString & ");")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCuentasEquipos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentasEquipos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
End If
|
||||
|
||||
' e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.FCLinkButton("LbIdentificador").Text = e.Row.DBCampo("Identificador").ToString
|
||||
e.Row.FCLinkButton("LbTipoCuentaEquipo").Text = e.Row.DBCampo("TipoCuentaEquipo").ToString
|
||||
e.Row.FCLinkButton("LbNoSerie").Text = e.Row.DBCampo("NoSerie").ToString
|
||||
e.Row.FCLinkButton("LbEstatus").Text = e.Row.DBCampo("Estatus").ToString
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvCuentasEquipos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvCuentasEquipos.RowDeleting
|
||||
Dim ObjCuentasEquipos As New ClsGenerales
|
||||
If ObjCuentasEquipos.RemoveCuentaEquipo(GvCuentasEquipos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
Alert("La Cuenta y/o Equipo se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
ViewState("DTCuentasEquipos") = ObjCuentasEquipos.DtResultados
|
||||
|
||||
CargarCuentasEquipos(Request("CveCliente").ToEntero)
|
||||
|
||||
End If
|
||||
ObjCuentasEquipos.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvCuentasEquipos.Rows.Count > 0) Then
|
||||
GvCuentasEquipos.UseAccessibleHeader = True
|
||||
GvCuentasEquipos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
166
OS/PopUpBuscarOS.aspx
Normal file
166
OS/PopUpBuscarOS.aspx
Normal file
@@ -0,0 +1,166 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarOS.aspx.vb" Inherits="OS_PopUpBuscarOS" %>
|
||||
|
||||
<%--<%@ Register Assembly="eWorld.UI, Version=2.0.6.2393, Culture=neutral, PublicKeyToken=24d65337282035f2" Namespace="eWorld.UI" TagPrefix="ew" %>--%>
|
||||
<%--<%@ 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">
|
||||
Búsqueda de Órdenes de Servicios
|
||||
</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>
|
||||
<table style="width: 750px">
|
||||
<tr>
|
||||
<td style="text-align: center;" class="Titulos" colspan="4"><b>Filtros para búsqueda</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right"><b>Folio:</b></td>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="12" Width="200px" autofocus></asp:TextBox>
|
||||
</td>
|
||||
<td class="text-right"><b>Cliente:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Nombre" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCliente" runat="server" ControlToValidate="DdlCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCliente" runat="server" HighlightCssClass="vco" TargetControlID="RFVCliente" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right"><b>Usuario Recibió:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlUsuarioRecibio" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVUsuarioRecibio" runat="server" ControlToValidate="DdlUsuarioRecibio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Usuario Recibió''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOUsuarioRecibio" runat="server" HighlightCssClass="vco" TargetControlID="RFVUsuarioRecibio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
|
||||
<%-- <tr>
|
||||
<td>Fecha Recibido:</td>
|
||||
<td> <td>
|
||||
<asp:TextBox ID="TxtFechaRecibido" runat="server" MaxLength="10" Width="94px"></asp:TextBox>
|
||||
<asp:ImageButton runat="server" ID="ImgFechaRecibido" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
|
||||
<ajax:MaskedEditExtender ID="MEEFechaRecibido" runat="server" TargetControlID="TxtFechaRecibido" Mask="99/99/9999" MaskType="Date" UserDateFormat="DayMonthYear" DisplayMoney="Left" AcceptNegative="Left">
|
||||
</ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaRecibido" TargetControlID="TxtFechaRecibido" PopupButtonID="ImgFechaRecibido" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaRecibido" runat="server" ControlToValidate="TxtFechaRecibido" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaRecibido''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFechaRecibido" runat="server" ControlToValidate="TxtFechaRecibido" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaRecibido''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaRecibido1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaRecibido" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFechaRecibido2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaRecibido" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
Hora:
|
||||
<ew:TimePicker ID="TxtHoraRecibido" runat="server" ControlDisplay="TextBoxImage" ImageUrl="/Imagenes/tool_timer.png" PopupWidth="100px" Width="70px" DisableTextBoxEntry="True" PopupHeight="150px" RoundUpMinutes="True" MilitaryTime="True" Culture="Spanish (Mexico)" LowerBoundTime="07:00" UpperBoundTime="20:30">
|
||||
<TimeStyle CssClass="Texto" />
|
||||
</ew:TimePicker>
|
||||
<ew:CustomValidator ID="CVHoraRecibido" runat="server" ClientValidationFunction="RevisaHora" ControlToValidate="TxtHoraRecibido" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="Guardar" ValidateEmptyText="true"></ew:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoHoraRecibido" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraRecibido" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</td>
|
||||
</td>
|
||||
</tr>--%>
|
||||
|
||||
<td class="text-right"><b>Estatus:</b></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlEstatusOrdenServicio" runat="server" AppendDataBoundItems="true" DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px !important;" ValidationGroup="GrpGuardar">
|
||||
<asp:ListItem Selected="True" Text="Sin Estado Asignado" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusOrdenServicio" runat="server" ControlToValidate="DdlEstatusOrdenServicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus de Orden de Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOEstatusOrdenServicio" runat="server" HighlightCssClass="vco" TargetControlID="RFVEstatusOrdenServicio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right"><b>Centro De Costo:</b></td>
|
||||
<td>
|
||||
<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: 200px !important;">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVSucursal" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Centro de Costos''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOSucursal" runat="server" HighlightCssClass="vco" TargetControlID="RFVSucursal" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="text-align: center;">
|
||||
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table id="TblBusqueda" runat="server" border="0" visible="false">
|
||||
<tr>
|
||||
<td align="left">Número de registros encontrados: <b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="DivBeneficiarios" style="overflow-y: auto; width: 760px; max-height: 215px;">
|
||||
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Órdenes de Servicios Encontrados." CssClass="table table-striped table-advance table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Folio</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFolio" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Cliente</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCliente" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Centro de Costo</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCentroCosto" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Descripción</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDescripcion" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatusOrdenServicio" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha Solicitud</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaRecepcion" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function Ir(c) {
|
||||
gotourl('/OS/OrdenesServicios.aspx?CveOS=' + c);
|
||||
}
|
||||
function Ir2(c) {
|
||||
window.opener.CargaOrdenServicio(c);
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
111
OS/PopUpBuscarOS.aspx.vb
Normal file
111
OS/PopUpBuscarOS.aspx.vb
Normal file
@@ -0,0 +1,111 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Partial Class OS_PopUpBuscarOS
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 500
|
||||
RegistraScript("$get('tdContenido').style.height='470px'")
|
||||
|
||||
CargaClientes()
|
||||
CargaUsuarioRecibio()
|
||||
CargaEstatusOrdenServicio()
|
||||
CargaSucursales()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||
Dim ObjOS As New ClsOS
|
||||
|
||||
Dim Folio As Integer = -1
|
||||
Dim CveCliente As Integer = -1
|
||||
Dim CveUsuarioRecibio As Integer = -1
|
||||
Dim CveEstatusOrdenServicio As Integer = -1
|
||||
Dim FechaRecibido As String = "-1"
|
||||
|
||||
|
||||
If TxtFolio.Text.Trim <> String.Empty Then Folio = TxtFolio.Text.ToEntero
|
||||
If DdlCliente.SelectedValue <> String.Empty Then CveCliente = DdlCliente.SelectedValue.ToEntero
|
||||
If DdlUsuarioRecibio.SelectedValue <> String.Empty Then CveUsuarioRecibio = DdlUsuarioRecibio.SelectedValue.ToEntero
|
||||
'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString()
|
||||
If DdlEstatusOrdenServicio.SelectedValue <> String.Empty Then CveEstatusOrdenServicio = DdlEstatusOrdenServicio.SelectedValue.ToEntero
|
||||
|
||||
|
||||
If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
If ObjOS.DtResultados.Rows.Count > 0 Then
|
||||
LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
||||
GV.DataSource = ObjOS.DtResultados
|
||||
Else
|
||||
LtlTotalRegistros.Text = "0"
|
||||
GV.DataSource = Nothing
|
||||
Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjOS.Dispose()
|
||||
GV.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
|
||||
TblBusqueda.Visible = True
|
||||
End Sub
|
||||
|
||||
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(70)
|
||||
End If
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Justify
|
||||
|
||||
Dim Liga As String = String.Empty
|
||||
|
||||
Liga = "<a class='Texto' href='javascript:Ir(""" & e.Row.DBCampo("CveOS") & """);'>"
|
||||
|
||||
'<div class='truncate' style='width:55px'>
|
||||
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div style='width:19px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Folio"))
|
||||
e.Row.FCLiteral("LtlCliente").Text = String.Format("<div class='truncate' style='width:260px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Cliente"))
|
||||
e.Row.FCLiteral("LtlCentroCosto").Text = String.Format("<div class='truncate' style='width:260px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("SubProyecto"))
|
||||
e.Row.FCLiteral("LtlDescripcion").Text = String.Format("<div class='truncate' style='width:230px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Descripcion"))
|
||||
e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = String.Format("<div class='truncate' style='width:65px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("EstatusOrdenServicio"))
|
||||
e.Row.FCLiteral("LtlFechaRecepcion").Text = String.Format("<div class='truncate' style='width:76px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("FechaRecepcion").ToDate.ToShortDateString)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaClientes()
|
||||
Dim ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
DdlCliente.DataSource = ObjClientes.DtResultados
|
||||
Else
|
||||
DdlCliente.DataSource = Nothing
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
DdlCliente.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarioRecibio()
|
||||
DdlUsuarioRecibio.Items.Clear()
|
||||
DdlUsuarioRecibio.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRecibio.DataBind()
|
||||
DdlUsuarioRecibio.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaEstatusOrdenServicio()
|
||||
DdlEstatusOrdenServicio.Items.Clear()
|
||||
DdlEstatusOrdenServicio.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
||||
DdlEstatusOrdenServicio.DataBind()
|
||||
DdlEstatusOrdenServicio.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSucursales()
|
||||
DdlSubProyecto.Items.Clear()
|
||||
DdlSubProyecto.SelectedValue = Nothing
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
183
OS/PopUpMateriales.aspx
Normal file
183
OS/PopUpMateriales.aspx
Normal file
@@ -0,0 +1,183 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpMateriales.aspx.vb" Inherits="OS_PopUpMateriales" %>
|
||||
|
||||
<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">
|
||||
Materiales para la Orden de Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="hdnClientIDLink" runat="server" ClientIDMode="Static" />
|
||||
<table border="0" class="contenido">
|
||||
<tr>
|
||||
<td>
|
||||
<div style="height: 300px">
|
||||
<fieldset>
|
||||
<legend><b>Materiales</b></legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos TextTab">
|
||||
<th width="50px">Cant</th>
|
||||
<th width="60px">UM</th>
|
||||
<th width="230px">Producto Servicio</th>
|
||||
<th width="183px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" ValidationGroup="GrpGuardar" Width="46px" Height="24px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="El campo <b>''Cantidad''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad2" runat="server" HighlightCssClass="vco" TargetControlID="CVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td align="center">
|
||||
<asp:Label ID="LblUnidadMedida" runat="server" Text="UM"></asp:Label>
|
||||
<asp:HiddenField ID="HdnUnidadMedida" runat="server" Value="-1" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 220px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="PSCodigo" DataValueField="CvePS" ValidationGroup="GrpGuardar" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 220px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="*** Actualizar listado de Productos o Servicios ***" Value="-2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEPS" runat="server" TargetControlID="DdlPS" PromptCssClass="Titulos" PromptText="Escriba el nombre o código del Producto o Servicio" QueryPattern="Contains" PromptPosition="Top" IsSorted="true" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVPS" runat="server" ControlToValidate="DdlPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvPS" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMaterialUtilizado" EmptyDataText="No se encontraron Materiales para la Orden de Servicio" ToolTip="Listado de Materiales para la Orden de Servicio" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad") %>' Visible="false"></asp:Literal>
|
||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" Text='<%# Eval("Cantidad") %>' ValidationGroup="GprGV" Width="45px" Height="24px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVCantidad" runat="server" ControlToValidate="TxtCantidad" Display="None" ErrorMessage="El campo <b>''Cantidad''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GprGV"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad1" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCantidad2" runat="server" HighlightCssClass="vco" TargetControlID="CVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUnidadMedida" runat="server" Text='<%# Eval("UM") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<span style="width: 220px; border-bottom: 1px solid gray;">
|
||||
<asp:Label ID="LblClasificacion" runat="server" Text='<%# Eval("Clasificacion") %>' Width="220px"></asp:Label></span>
|
||||
<br />
|
||||
<asp:Label ID="LblPS" runat="server" Text='<%# Eval("PS") %>' Width="220px"></asp:Label>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 220px !important;" OnSelectedIndexChanged="DdlClasificacion_SelectedIndexChanged1">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="PSCodigo" DataValueField="CvePS" ValidationGroup="GprGV" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 220px !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="*** Actualizar listado de Productos o Servicios ***" Value="-2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<ajax:ListSearchExtender ID="LSEPS" runat="server" TargetControlID="DdlPS" PromptCssClass="Titulos" PromptText="Escriba el nombre o código del Producto o Servicio" QueryPattern="Contains" PromptPosition="Top" IsSorted="true" QueryTimeout="0"></ajax:ListSearchExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVPS" runat="server" ControlToValidate="DdlPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GprGV"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSeFacturara" runat="server" Text='<%# Eval("SeFacturaraTexto").ToString%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:CheckBox ID="ChkSeFacturara" runat="server" Checked='<%# Eval("SeFacturara").ToString = "1"%>' />
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="ImgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="ImgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgD" runat="server" AlternateText="Elim" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div style="text-align: center">
|
||||
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" class="btn btn-primary" />
|
||||
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" class="btn btn-danger" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar el Material para la Orden de Servicio?');
|
||||
}
|
||||
|
||||
function CargaMateriales(Materiales, Consecutivo) {
|
||||
// var ClientIDLink = document.getElementById("hdnClientIDLink").value;
|
||||
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
//parent.CargaMateriales(Materiales, Consecutivo, ClientIDLink);
|
||||
parent.CargaMateriales(Materiales, Consecutivo);
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
// window.opener.CargaMateriales(Materiales, Consecutivo, ClientIDLink);
|
||||
window.opener.CargaMateriales(Materiales, Consecutivo);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
function Cancelar() {
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
354
OS/PopUpMateriales.aspx.vb
Normal file
354
OS/PopUpMateriales.aspx.vb
Normal file
@@ -0,0 +1,354 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_PopUpMateriales
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CveOSDetalle As Integer
|
||||
Get
|
||||
Return ViewState("CveOSDetalle").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveOSDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Consecutivo As Integer
|
||||
Get
|
||||
Return ViewState("Consecutivo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Consecutivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTPS As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTPS"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 500
|
||||
RegistraScript("$get('tdContenido').style.height='350px'")
|
||||
|
||||
CargaPS(-1, DdlPS)
|
||||
CargaClasificaciones()
|
||||
|
||||
CveOSDetalle = Request("CveOSDetalle").ToEntero
|
||||
ViewState("Consecutivo") = Request("Consecutivo").ToEntero
|
||||
ViewState("Orden") = ""
|
||||
|
||||
If CveOSDetalle = 0 Then
|
||||
UpTitulos.Visible = False
|
||||
Else
|
||||
CreaDT()
|
||||
CargaMateriales()
|
||||
End If
|
||||
|
||||
If Not Request("EsThickbox") Is Nothing Then
|
||||
hdnEsThickbox.Value = Request("EsThickbox")
|
||||
Else
|
||||
hdnEsThickbox.Value = "N"
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(74) = False Then GvPS.Columns(3).Visible = False
|
||||
'If Not Request("ClientIDLink") Is Nothing Then
|
||||
' hdnClientIDLink.Value = Request("ClientIDLink")
|
||||
'Else
|
||||
' hdnClientIDLink.Value = "NoDefinido"
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDT()
|
||||
TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("Consecutivo", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveMaterialUtilizado", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CveUnidadMedida", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("SeFacturara", GetType(String))
|
||||
TmpDT.Columns.Add("SeFacturaraTexto", GetType(String))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
DdlClasificacion.DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlClasificacion.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As DropDownList)
|
||||
Dim ObjPS As New ClsProductosServicios()
|
||||
If ObjPS.GetPS(-1, CveClasificacion, UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTPS") = ObjPS.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND Estado = 'Activo'", "PS")
|
||||
Objeto.Items.Clear()
|
||||
Objeto.DataSource = ViewState("DTPS")
|
||||
Objeto.DataBind()
|
||||
Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
Objeto.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS(DdlClasificacion.SelectedValue.ToEntero, DdlPS)
|
||||
UpTitulos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMateriales()
|
||||
Try
|
||||
Dim objOS As New ClsOS
|
||||
|
||||
If objOS.GetDetalleMateriales(CveOSDetalle, -1) Then
|
||||
For Each Material As DataRow In objOS.DtResultados.Rows
|
||||
Dim RowPS As DataRow = DTPS.FiltraParametros("CvePS = " & Material("CvePS").ToString).Rows(0)
|
||||
Dim PS As String = RowPS("PS").ToString
|
||||
Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString.ToEntero
|
||||
Dim UM = GlobalDTUnidadesMedida.FiltraParametros("CveUnidadMedida = " & CveUnidadMedida).Rows(0)("UnidadMedida").ToString
|
||||
Dim CveClasificacion As Integer = RowPS("CveClasificacion").ToString.ToEntero
|
||||
Dim Clasificacion As String = GlobalDTClasificaciones.FiltraParametros("CveClasificacion = " & CveClasificacion).Rows(0)("Clasificacion").ToString
|
||||
|
||||
AddPS(Material("CveMaterialUtilizado").ToString.ToEntero, CveOSDetalle, Material("Cantidad").ToString.ToDecimal, CveUnidadMedida, UM, Material("CvePS").ToString.ToEntero, PS, CveClasificacion, Clasificacion, Material("SeFacturara").ToString)
|
||||
Next
|
||||
End If
|
||||
objOS.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Alert("Error al cargar los Materiales", TipoMensaje.MsgError)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvPS_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
|
||||
GvPS.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvPS_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvPS.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(60)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(230)
|
||||
|
||||
If e.Row.Cells(3).Visible = True Then
|
||||
e.Row.Cells(3).Width = Unit.Pixel(80)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
Else
|
||||
e.Row.Cells(4).Width = Unit.Pixel(180)
|
||||
End If
|
||||
|
||||
'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlPS").DataSource = DTPS
|
||||
e.Row.FCDropDownList("DdlPS").DataBind()
|
||||
e.Row.FCDropDownList("DdlPS").SelectedValue = e.Row.DBCampo("CvePS")
|
||||
|
||||
e.Row.FCDropDownList("DdlClasificacion").DataSource = GlobalDTClasificaciones.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlClasificacion").DataBind()
|
||||
e.Row.FCDropDownList("DdlClasificacion").SelectedValue = e.Row.DBCampo("CveClasificacion")
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvPS_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvPS.RowEditing
|
||||
GvPS.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvPS_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvPS.RowDeleting
|
||||
Dim CveMaterialUtilizado As Integer = GvPS.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
If CveMaterialUtilizado > 0 Then
|
||||
Dim objMateriales As New ClsOS
|
||||
If objMateriales.RemoveDetalleMateriales(CveMaterialUtilizado, CveOSDetalle) Then
|
||||
|
||||
End If
|
||||
End If
|
||||
Dim i As Integer = TmpDT.Rows.IndexOf(TmpDT.Rows(e.RowIndex))
|
||||
|
||||
TmpDT.Rows.RemoveAt(i)
|
||||
|
||||
UpTitulos.Update()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
GvPS.DataSource = TmpDT.FiltraParametros("", Orden)
|
||||
Else
|
||||
GvPS.DataSource = TmpDT
|
||||
End If
|
||||
GvPS.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
If TmpDT.FiltraParametros("CvePS = " + DdlPS.SelectedValue.ToString).Rows.Count = 0 Then
|
||||
AddPS(-(TmpDT.Rows.Count + 1), CveOSDetalle, TxtCantidad.Text.ToDecimal, HdnUnidadMedida.Value.ToEntero, LblUnidadMedida.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, "Sí")
|
||||
UpTitulos.Update()
|
||||
End If
|
||||
DdlClasificacion.SelectedIndex = 0
|
||||
DdlPS.SelectedIndex = 0
|
||||
TxtCantidad.Text = ""
|
||||
End Sub
|
||||
|
||||
Private Sub AddPS(CveMaterialUtilizado As Integer, CveOSDetalle As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, UM As String, CvePS As Integer, PS As String, CveClasificacion As Integer, Clasificacion As String, SeFacturara As String)
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = TmpDT.NewRow()
|
||||
|
||||
Row("Consecutivo") = Consecutivo
|
||||
Row("CveMaterialUtilizado") = CveMaterialUtilizado
|
||||
Row("CveOSDetalle") = CveOSDetalle
|
||||
Row("Cantidad") = Cantidad
|
||||
Row("CveUnidadMedida") = CveUnidadMedida
|
||||
Row("UM") = UM
|
||||
Row("CvePS") = CvePS
|
||||
Row("PS") = PS
|
||||
Row("CveClasificacion") = CveClasificacion
|
||||
Row("Clasificacion") = Clasificacion
|
||||
Row("SeFacturara") = SeFacturara
|
||||
Row("SeFacturaraTexto") = If(SeFacturara = "1", "Si", "No")
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
'Guardar los materiales directo a la base de datos
|
||||
Dim objMateriales As New ClsOS
|
||||
|
||||
For Each R As DataRow In TmpDT.Rows
|
||||
If R("CveMaterialUtilizado").ToString.ToEntero < 0 Then
|
||||
objMateriales.AddDetalleMateriales(R("CveOsDetalle").ToString.ToEntero, R("Cantidad").ToString.ToDecimal, R("CveUnidadMedida").ToString.ToEntero, R("CvePS").ToString.ToEntero, If(R("SeFacturara").ToString = "1", True, False))
|
||||
Else
|
||||
objMateriales.UpdateDetalleMateriales(R("CveMaterialUtilizado").ToString.ToEntero, R("CveOsDetalle").ToString.ToEntero, R("Cantidad").ToString.ToDecimal, R("CveUnidadMedida").ToString.ToEntero, R("CvePS").ToString.ToEntero, If(R("SeFacturara").ToString = "1", True, False))
|
||||
End If
|
||||
Next
|
||||
objMateriales.Dispose()
|
||||
'RegistraScript(String.Format("CargaEspecificaciones('{0}', '{1}');", Especificaciones, EspecificacionesS))
|
||||
RegistraScript(String.Format("CargaMateriales('{0}', '{1}');", "", Consecutivo))
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged1(sender As Object, e As EventArgs)
|
||||
Dim ddl As DropDownList = DirectCast(sender, DropDownList)
|
||||
Dim DdlGVPS As DropDownList = Nothing
|
||||
|
||||
Dim gvr As GridViewRow = DirectCast(ddl.NamingContainer, GridViewRow)
|
||||
|
||||
DdlGVPS = GvPS.Rows(gvr.RowIndex).FCDropDownList("DdlPS")
|
||||
If DdlGVPS IsNot Nothing Then CargaPS(DirectCast(sender, DropDownList).SelectedValue.ToEntero, DdlGVPS)
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.SelectedIndexChanged
|
||||
If DdlPS.SelectedIndex > 1 Then
|
||||
Dim PS As DataTable = DTPS.FiltraParametros("CvePS = " & DdlPS.SelectedValue)
|
||||
If PS.Rows.Count > 0 Then
|
||||
HdnUnidadMedida.Value = PS.Rows(0)("CveUnidadMedida").ToString
|
||||
LblUnidadMedida.Text = PS.Rows(0)("UnidadMedida").ToString
|
||||
DdlClasificacion.SelectedValue = PS.Rows(0)("CveClasificacion").ToString
|
||||
End If
|
||||
'RegistraScript("Recalcula();")
|
||||
PS.Dispose()
|
||||
UpTitulos.Update()
|
||||
ElseIf DdlPS.SelectedValue = "-2" Then
|
||||
CargaPS(-1, DdlPS)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Handles BtnCancelar.Click
|
||||
RegistraScript("Cancelar();")
|
||||
End Sub
|
||||
|
||||
Protected Sub GvPS_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPS.RowUpdating
|
||||
Dim Cantidad As Decimal = GvPS.Rows(e.RowIndex).FCTextBox("txtCantidad").Text.ToDecimal
|
||||
Dim CveClasificacion As Integer = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion").SelectedValue.ToEntero
|
||||
Dim Clasificacion As String = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion").SelectedItem.Text
|
||||
Dim CvePS As Integer = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedValue.ToEntero
|
||||
Dim PS As String = GvPS.Rows(e.RowIndex).FCDropDownList("DdlPS").SelectedItem.Text
|
||||
Dim SeFacturara As String = If(GvPS.Rows(e.RowIndex).FCCheckBox("ChkSeFacturara").Checked, "1", "0")
|
||||
|
||||
TmpDT.Rows(e.RowIndex)("Cantidad") = Cantidad
|
||||
TmpDT.Rows(e.RowIndex)("CveClasificacion") = CveClasificacion
|
||||
TmpDT.Rows(e.RowIndex)("Clasificacion") = Clasificacion
|
||||
TmpDT.Rows(e.RowIndex)("CvePS") = CvePS
|
||||
TmpDT.Rows(e.RowIndex)("PS") = PS
|
||||
TmpDT.Rows(e.RowIndex)("SeFacturara") = SeFacturara
|
||||
TmpDT.Rows(e.RowIndex)("SeFacturaraTexto") = If(SeFacturara = "1", "Si", "No")
|
||||
|
||||
GvPS.EditIndex = -1
|
||||
GvPS.DataSource = TmpDT
|
||||
GvPS.DataBind()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
192
OS/PopUpOS_PS_Especificaciones.aspx
Normal file
192
OS/PopUpOS_PS_Especificaciones.aspx
Normal file
@@ -0,0 +1,192 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpOS_PS_Especificaciones.aspx.vb" Inherits="OS_PopUpOS_PS_Especificaciones" %>
|
||||
|
||||
<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">
|
||||
Especificaciones del Producto o Servicio
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="hdnClientIDLink" runat="server" ClientIDMode="Static" />
|
||||
<table border="0" class="contenido">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<div>
|
||||
<fieldset>
|
||||
<legend><b>Especificaciones del Producto o Servicio:</b></legend>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>Clasificación: </td>
|
||||
<td><b>
|
||||
<asp:Literal ID="LtlClasificacion" runat="server"></asp:Literal></b></td>
|
||||
<td width="100px"></td>
|
||||
<td>Unidad de Medida: </td>
|
||||
<td><b>
|
||||
<asp:Literal ID="LtlUM" runat="server"></asp:Literal></b></td>
|
||||
<td rowspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Producto Servicio: </td>
|
||||
<td><b>
|
||||
<asp:Literal ID="LtlProductoServicio" runat="server"></asp:Literal></b></td>
|
||||
<td></td>
|
||||
<td>Codigo: </td>
|
||||
<td><b>
|
||||
<asp:Literal ID="LtlCodigo" runat="server"></asp:Literal></b></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div >
|
||||
<fieldset>
|
||||
<legend><b>Especificaciones</b></legend>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="150px"> </th>
|
||||
<th width="160px">
|
||||
<asp:LinkButton ID="LbCaracteristica" runat="server" CausesValidation="false" Text="" CommandArgument="Caracteristica" OnClick="LbOrden_Click">
|
||||
Característica
|
||||
<asp:Literal ID="ImgCaracteristica" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="160px">
|
||||
<asp:LinkButton ID="LbValor" runat="server" CausesValidation="false" Text="" CommandArgument="Valor" OnClick="LbOrden_Click">
|
||||
Valor
|
||||
<asp:Literal ID="ImgValor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
|
||||
</asp:LinkButton></th>
|
||||
<th width="155px">Comandos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" CssClass="form-control input-sm select2me" Style="width: 150px !important;" ValidationGroup="GrpGuardarC">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlOpcion" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Opcion" DataValueField="CveOpcion" CssClass="form-control input-sm select2me" Style="width: 150px !important;" ValidationGroup="GrpGuardarC">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="DdlOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opcion''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcion" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<asp:TextBox ID="txtValor" runat="server" Width="150px" Visible="false"></asp:TextBox>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarC"></asp:LinkButton></td>
|
||||
</tr>
|
||||
</table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional" style="max-height: 150px; overflow-y:auto;">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvValoresCaracteristicas" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePSCaracteristica" EmptyDataText="No se encontraron Especificaciones para El Producto o Servicio" ToolTip="Listado de Especificaciones para El Producto o Servicio" CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlProductoServicio" runat="server" Text='<%# Eval("PS") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" OnSelectedIndexChanged="DdlCaracteristicaEdit_SelectedIndexChanged" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardarC">
|
||||
</asp:DropDownList>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlValor" runat="server" Text='<%# Eval("Valor") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:DropDownList ID="DdlOpcion" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Opcion" DataValueField="CveOpcion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardarC">
|
||||
</asp:DropDownList>
|
||||
<asp:TextBox ID="TxtValor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Valor")%>' ValidationGroup="GrpGuardarC" Width="100px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVValor" runat="server" ControlToValidate="TxtValor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Valor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOValor" runat="server" HighlightCssClass="vco" TargetControlID="RFVValor" Width="100px"></ajax:ValidatorCalloutExtender>
|
||||
</EditItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<EditItemTemplate>
|
||||
<center>
|
||||
<asp:LinkButton ID="ImgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
|
||||
<asp:LinkButton ID="ImgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
</center>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="ImgD" runat="server" AlternateText="Elim" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div style="text-align: center">
|
||||
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" class="btn btn-primary" />
|
||||
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" class="btn btn-default" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script language="javascript" type="text/javascript">
|
||||
function C() {
|
||||
return confirm('¿Está seguro que desea eliminar la Especificacion para el Producto o Servicio?');
|
||||
}
|
||||
|
||||
function CargaEspecificaciones(Especificaciones) {
|
||||
var ClientIDLink = document.getElementById("hdnClientIDLink").value;
|
||||
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
parent.CargaEspecificaciones(Especificaciones, ClientIDLink);
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
window.opener.CargaEspecificaciones(Especificaciones, ClientIDLink);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
function Cancelar() {
|
||||
if (document.getElementById("hdnEsThickbox").value == "S") {
|
||||
parent.tb_remove();
|
||||
}
|
||||
else {
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
353
OS/PopUpOS_PS_Especificaciones.aspx.vb
Normal file
353
OS/PopUpOS_PS_Especificaciones.aspx.vb
Normal file
@@ -0,0 +1,353 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_PopUpOS_PS_Especificaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property CvePS As Integer
|
||||
Get
|
||||
Return ViewState("CvePS").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
CType(Me.Master, BaseMasterPage).PopupWidth = 601
|
||||
RegistraScript("$get('tdContenido').style.height='400px'")
|
||||
ViewState("Orden") = ""
|
||||
|
||||
CvePS = Request("CvePS").ToEntero
|
||||
|
||||
If CvePS = 0 Then
|
||||
UpTitulos.Visible = False
|
||||
Else
|
||||
CreaDT()
|
||||
CargaPS()
|
||||
|
||||
If Not Request("Especificaciones") Is Nothing AndAlso Request("Especificaciones") <> "" Then
|
||||
CargaEspecificiones(Request("Especificaciones"))
|
||||
End If
|
||||
|
||||
CargaPSCaracteristicas()
|
||||
CargaPSCaracteristicasOpciones()
|
||||
End If
|
||||
|
||||
If Not Request("EsThickbox") Is Nothing Then
|
||||
hdnEsThickbox.Value = Request("EsThickbox")
|
||||
Else
|
||||
hdnEsThickbox.Value = "N"
|
||||
End If
|
||||
|
||||
If Not Request("ClientIDLink") Is Nothing Then
|
||||
hdnClientIDLink.Value = Request("ClientIDLink")
|
||||
Else
|
||||
hdnClientIDLink.Value = "NoDefinido"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDT()
|
||||
TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveValor", GetType(Integer))
|
||||
TmpDT.Columns.Add("CvePSCaracteristica", GetType(Integer))
|
||||
TmpDT.Columns.Add("Caracteristica", GetType(String))
|
||||
TmpDT.Columns.Add("EsOpcion", GetType(String))
|
||||
TmpDT.Columns.Add("CveOpcion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Opcion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("Valor", GetType(String))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPS()
|
||||
Dim ObjPS As New ClsProductosServicios()
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjPS.DtResultados.Rows.Count = 1 Then
|
||||
LtlClasificacion.Text = ObjPS.DtResultados.Rows(0)("Clasificacion").ToString
|
||||
LtlProductoServicio.Text = ObjPS.DtResultados.Rows(0)("PS").ToString
|
||||
LtlUM.Text = ObjPS.DtResultados.Rows(0)("UnidadMedida").ToString
|
||||
LtlCodigo.Text = ObjPS.DtResultados.Rows(0)("Codigo").ToString
|
||||
End If
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEspecificiones(Especificaciones As String)
|
||||
Try
|
||||
Dim LEspecificaciones As String()
|
||||
LEspecificaciones = Especificaciones.Split(CChar(","))
|
||||
|
||||
For Each S As String In LEspecificaciones
|
||||
Dim Esp As String() = S.Split(CChar(":"))
|
||||
AddEspecificacion(0, Esp(0).ToEntero, Esp(1), Esp(2), Esp(3).ToEntero, Esp(4), Esp(5), CvePS, LtlProductoServicio.Text)
|
||||
Next
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Alert("Error al cargar las Especificaciones", TipoMensaje.MsgError)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvValoresCaracteristicas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvValoresCaracteristicas.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
' e.Row.Cells(0).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(150)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(160)
|
||||
e.Row.Cells(3).Width = Unit.Pixel(160)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(155)
|
||||
'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||
e.Row.FCDropDownList("DdlCaracteristica").DataSource = GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("CvePS = " + CvePS.ToString)
|
||||
e.Row.FCDropDownList("DdlCaracteristica").DataBind()
|
||||
e.Row.FCDropDownList("DdlCaracteristica").SelectedValue = e.Row.DBCampo("CvePSCaracteristica")
|
||||
|
||||
'Verificar si es Opcion
|
||||
If e.Row.DBCampo("EsOpcion") = "Sí" Then
|
||||
e.Row.FCTextBox("TxtValor").Visible = False
|
||||
e.Row.FCDropDownList("DdlOpcion").Visible = True
|
||||
e.Row.FCDropDownList("DdlOpcion").DataSource = GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa).FiltraParametros("CvePSCaracteristica = " & e.Row.DBCampo("CvePSCaracteristica").ToString)
|
||||
e.Row.FCDropDownList("DdlOpcion").DataBind()
|
||||
e.Row.FCDropDownList("DdlOpcion").SelectedValue = e.Row.DBCampo("CveOpcion")
|
||||
Else
|
||||
e.Row.FCTextBox("TxtValor").Visible = True
|
||||
e.Row.FCDropDownList("DdlOpcion").Visible = False
|
||||
e.Row.FCTextBox("TxtValor").Text = e.Row.DBCampo("Valor").ToString
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvValoresCaracteristicas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvValoresCaracteristicas.RowEditing
|
||||
GvValoresCaracteristicas.EditIndex = e.NewEditIndex
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvValoresCaracteristicas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvValoresCaracteristicas.RowDeleting
|
||||
Dim CvePSCaracteristica As Integer = GvValoresCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||
|
||||
Dim i As Integer = TmpDT.Rows.IndexOf(TmpDT.Rows(e.RowIndex))
|
||||
|
||||
TmpDT.Rows.RemoveAt(i)
|
||||
|
||||
CargaPSCaracteristicas()
|
||||
CargaPSCaracteristicasOpciones()
|
||||
UpTitulos.Update()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGrid(Orden As String)
|
||||
If Orden <> String.Empty Then
|
||||
GvValoresCaracteristicas.DataSource = TmpDT.FiltraParametros("", Orden)
|
||||
Else
|
||||
GvValoresCaracteristicas.DataSource = TmpDT
|
||||
End If
|
||||
GvValoresCaracteristicas.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub GvValoresCaracteristicas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvValoresCaracteristicas.RowCancelingEdit
|
||||
GvValoresCaracteristicas.EditIndex = -1
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSCaracteristicas()
|
||||
If TmpDT.Rows.Count = 0 Then
|
||||
DdlCaracteristica.Items.Clear()
|
||||
DdlCaracteristica.DataSource = GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("CvePS = " + CvePS.ToString)
|
||||
DdlCaracteristica.DataBind()
|
||||
Else
|
||||
Dim CvePSCaracteristicasAgregadas As String = ""
|
||||
For Each R As DataRow In TmpDT.Rows
|
||||
If CvePSCaracteristicasAgregadas <> "" Then
|
||||
CvePSCaracteristicasAgregadas = CvePSCaracteristicasAgregadas + ","
|
||||
End If
|
||||
CvePSCaracteristicasAgregadas = CvePSCaracteristicasAgregadas + R("CvePSCaracteristica").ToString
|
||||
Next
|
||||
DdlCaracteristica.Items.Clear()
|
||||
DdlCaracteristica.DataSource = GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0} and CvePSCaracteristica Not In ({1})", CvePS.ToString, CvePSCaracteristicasAgregadas))
|
||||
DdlCaracteristica.DataBind()
|
||||
End If
|
||||
DdlCaracteristica_SelectedIndexChanged(New Object, New EventArgs)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPSCaracteristicasOpciones()
|
||||
DdlOpcion.Items.Clear()
|
||||
If DdlCaracteristica.SelectedValue.ToString <> "" Then
|
||||
DdlOpcion.DataSource = GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa).FiltraParametros("CvePSCaracteristica = " + DdlCaracteristica.SelectedValue.ToString)
|
||||
DdlOpcion.DataBind()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCaracteristica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristica.SelectedIndexChanged
|
||||
If DdlCaracteristica.SelectedValue <> "" Then
|
||||
Dim DV As New DataView(GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("CvePSCaracteristica = " + DdlCaracteristica.SelectedValue.ToString))
|
||||
If DV(0)("EsOpcion").ToString = "Sí" Then
|
||||
DdlOpcion.Visible = True
|
||||
CargaPSCaracteristicasOpciones()
|
||||
txtValor.Visible = False
|
||||
Else
|
||||
DdlOpcion.Visible = False
|
||||
txtValor.Visible = True
|
||||
End If
|
||||
Else
|
||||
DdlOpcion.ClearSelection()
|
||||
DdlOpcion.DataSource = ""
|
||||
DdlOpcion.DataBind()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
|
||||
If DdlCaracteristica.SelectedValue <> "" Then
|
||||
If TmpDT.FiltraParametros("CvePSCaracteristica = " + DdlCaracteristica.SelectedValue.ToString).Rows.Count = 0 Then
|
||||
Dim EsOpcion As String
|
||||
Dim CveOpcion As Integer
|
||||
Dim Opcion As String
|
||||
Dim Valor As String
|
||||
|
||||
If DdlOpcion.Visible = True Then
|
||||
EsOpcion = "Sí"
|
||||
CveOpcion = DdlOpcion.SelectedValue.ToEntero
|
||||
Opcion = DdlOpcion.SelectedItem.Text
|
||||
Valor = "-1"
|
||||
Else
|
||||
EsOpcion = "No"
|
||||
CveOpcion = -1
|
||||
Opcion = "-1"
|
||||
Valor = txtValor.Text
|
||||
End If
|
||||
|
||||
AddEspecificacion(0, DdlCaracteristica.SelectedValue.ToEntero, DdlCaracteristica.SelectedItem.Text, EsOpcion, CveOpcion, Opcion, Valor, CvePS, LtlProductoServicio.Text)
|
||||
|
||||
CargaPSCaracteristicas()
|
||||
CargaPSCaracteristicasOpciones()
|
||||
UpTitulos.Update()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AddEspecificacion(CveValor As Integer, CvePSCaracteristica As Integer, Caracteristica As String, EsOpcion As String, CveOpcion As Integer,
|
||||
Opcion As String, Valor As String, CvePS As Integer, PS As String)
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = TmpDT.NewRow()
|
||||
|
||||
Row("CveValor") = CveValor
|
||||
Row("CvePSCaracteristica") = CvePSCaracteristica
|
||||
Row("Caracteristica") = Caracteristica
|
||||
Row("EsOpcion") = EsOpcion
|
||||
Row("CveOpcion") = CveOpcion
|
||||
Row("Opcion") = Opcion
|
||||
|
||||
If EsOpcion = "Sí" Then
|
||||
Row("Valor") = Opcion
|
||||
Else
|
||||
Row("Valor") = Valor
|
||||
End If
|
||||
|
||||
Row("CvePS") = CvePS
|
||||
Row("PS") = PS
|
||||
|
||||
TmpDT.Rows.Add(Row)
|
||||
GvValoresCaracteristicas.DataSource = TmpDT
|
||||
GvValoresCaracteristicas.DataBind()
|
||||
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
Dim Especificaciones As String = "-1"
|
||||
|
||||
For Each R As DataRow In TmpDT.Rows
|
||||
If Especificaciones = "-1" Then Especificaciones = "" Else Especificaciones = Especificaciones + ","
|
||||
Especificaciones = Especificaciones + String.Format("{0}:{1}:{2}:{3}:{4}:{5}", R("CvePSCaracteristica").ToString, R("Caracteristica").ToString, R("EsOpcion"), R("CveOpcion").ToString, R("Opcion").ToString, R("Valor").ToString)
|
||||
Next
|
||||
RegistraScript(String.Format("CargaEspecificaciones('{0}');", Especificaciones))
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCaracteristicaEdit_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim ddl As DropDownList = DirectCast(sender, DropDownList)
|
||||
|
||||
Dim gvr As GridViewRow = DirectCast(ddl.NamingContainer, GridViewRow)
|
||||
|
||||
Dim DV As New DataView(GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("CvePSCaracteristica = " + ddl.SelectedValue.ToString))
|
||||
If DV(0)("EsOpcion").ToString = "Sí" Then
|
||||
With GvValoresCaracteristicas.Rows(gvr.RowIndex).FCDropDownList("DdlOpcionEdit")
|
||||
.Visible = True
|
||||
.DataSource = GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa).FiltraParametros("CvePSCaracteristica = " & ddl.SelectedValue.ToString)
|
||||
.DataBind()
|
||||
' .SelectedValue = GvValoresCaracteristicas.Rows(gvr.RowIndex).DBCampo("CveOpcion")
|
||||
End With
|
||||
GvValoresCaracteristicas.Rows(gvr.RowIndex).FCTextBox("txtValor").Visible = False
|
||||
Else
|
||||
GvValoresCaracteristicas.Rows(gvr.RowIndex).FCDropDownList("DdlOpcionEdit").Visible = False
|
||||
GvValoresCaracteristicas.Rows(gvr.RowIndex).FCTextBox("txtValor").Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Handles BtnCancelar.Click
|
||||
RegistraScript("Cancelar();")
|
||||
End Sub
|
||||
End Class
|
||||
1368
OS/RecepcionEntrega.aspx.vb
Normal file
1368
OS/RecepcionEntrega.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
287
OS/RepOrdenesServicios.aspx
Normal file
287
OS/RepOrdenesServicios.aspx
Normal file
@@ -0,0 +1,287 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrdenesServicios.aspx.vb" Inherits="OS_RepOrdenesServicios" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.Widthall {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner {
|
||||
width: 100% !important;
|
||||
background-color: #dddddd;
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollFoot {
|
||||
display: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.table-scrollable {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scroll {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.table.dataTable {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody table th {
|
||||
padding: 0px !important;
|
||||
padding-right: 4px !important;
|
||||
padding-left: 4px !important;
|
||||
}
|
||||
|
||||
.sinlink td a {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
color: black;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.white a {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.btn-verde {
|
||||
color: #32c5d2;
|
||||
background-color: #fff;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde .fa-plus {
|
||||
color: #32c5d2 !important;
|
||||
}
|
||||
|
||||
.btn-verde:hover {
|
||||
color: #fff;
|
||||
background-color: #32c5d2;
|
||||
border-color: #32c5d2;
|
||||
}
|
||||
|
||||
.btn-verde:hover .fa-plus {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.Excede {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Ordenes de Servicio
|
||||
</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">
|
||||
<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;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
|
||||
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<label class="col-md-1">Cliente: </label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlClientes" DataTextField="Nombre" DataValueField="CveCliente" runat="server" AutoPostBack="true">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Centro de Costo:</label>
|
||||
<div 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">
|
||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Estatus:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlEstatusOS" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="EstatusOrdenServicio" DataValueField="CveEstatusOrdenServicio" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
<label class="col-md-1 ">Técnico:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlTecnico" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Recibió:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlUsuarioRecibio" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" runat="server" DataTextField="Nombre" DataValueField="CveUsuario"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 ">Facturado:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlFacturado" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="FACTURADAS" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="POR FACTURAR" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="SIN FACTURA" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">F.I.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox 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>
|
||||
<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>
|
||||
<label class="col-md-1 truncate">F.F.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox 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>
|
||||
<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>
|
||||
<label class="col-md-1 truncate">Fecha Terminado:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaTerminado" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioT" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaTerminado" PopupButtonID="imgCalendarioT" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtFechaTerminado" Display="None" ErrorMessage="El campo <b>''Fecha Terminado''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaTerminado" Display="None" ErrorMessage="El campo <b>''Fecha Terminado''</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="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" Width="100%" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ordenes de Servicio registradas" ToolTip="Listado de Ordenes de Servicio" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Folio
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("Folio", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="Excede truncate">
|
||||
<HeaderTemplate>
|
||||
Descripción
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlDescripcion" runat="server" data-toggle="tooltip" title='<%# Eval("Descripcion","{0}")%>' Text='<%# Eval("Descripcion", "{0}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="Excede truncate">
|
||||
<HeaderTemplate>
|
||||
Cliente
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlCliente" runat="server" data-toggle="tooltip" title='<%# Eval("Cliente", "{0}")%>' Text='<%# Eval("Cliente", "{0}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
SubProyecto
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto", "{0}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
Fecha Recepción
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaRecepcion" runat="server" Text='<%# Eval("FechaRecepcion", "{0:d}")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="Excede truncate">
|
||||
<HeaderTemplate>
|
||||
Usuario Recibió
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlUsuarioRecibio" runat="server" data-toggle="tooltip" title='<%# Eval("UsuarioRecibio")%>' Text='<%# Eval("UsuarioRecibio")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
Estatus
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatusOrdenServicio" runat="server" Text='<%# Eval("EstatusOrdenServicio")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Fecha Cita</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaCita" runat="server" Text='<%# Eval("FechaCita")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
|
||||
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function OrdenarGV() {
|
||||
var Tam = TamañoVentana();
|
||||
var Alto = Tam.height - 270;
|
||||
if (Alto < 100) {
|
||||
Alto = 100;
|
||||
}
|
||||
$('#C_GvDatos').DataTable({
|
||||
scrollY: Alto + 'px',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
searching: false,
|
||||
info: false
|
||||
});
|
||||
$('#C_GvDatos').parent().parent().children().first().css("position", "static");
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
122
OS/RepOrdenesServicios.aspx.vb
Normal file
122
OS/RepOrdenesServicios.aspx.vb
Normal file
@@ -0,0 +1,122 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class OS_RepOrdenesServicios
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("Orden") = ""
|
||||
CargaCombos()
|
||||
|
||||
If Request("CveUsuarioTecnico") IsNot Nothing AndAlso IsNumeric(Request("CveUsuarioTecnico")) AndAlso Request("CveUsuarioTecnico").ToEntero > 0 Then
|
||||
ViewState("CveUsuarioTecnico") = Request("CveUsuarioTecnico")
|
||||
DdlTecnico.SelectedValueExist(ViewState("CveUsuarioTecnico"))
|
||||
Else
|
||||
ViewState("CveUsuarioTecnico") = -1
|
||||
End If
|
||||
|
||||
CargaDatos()
|
||||
OrdenaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
'CargaClientes
|
||||
DdlClientes.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'CargaSubProyectos
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
'CargaUsuarios
|
||||
DdlUsuarioRecibio.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRecibio.DataBind()
|
||||
DdlUsuarioRecibio.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'CargaEstatus
|
||||
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
||||
DdlEstatusOS.DataBind()
|
||||
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
'CargaTecnico
|
||||
DdlTecnico.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlTecnico.DataBind()
|
||||
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjOrdenesServicios As New ClsOS()
|
||||
|
||||
Dim FechaI, FechaF, FechaTerminado As String
|
||||
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
||||
FechaTerminado = If(IsDate(TxtFechaTerminado.Text.Trim()), TxtFechaTerminado.Text.Trim(), "-1")
|
||||
|
||||
If ObjOrdenesServicios.GetRepOrdenesServicio(FechaI, FechaF, FechaTerminado, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlUsuarioRecibio.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim Filtro As String = ""
|
||||
Select Case DdlFacturado.SelectedValue
|
||||
Case "1"
|
||||
'FACTURADAS
|
||||
Filtro = "NoFacturar > 0 AND NoFacturar = NoFacturados"
|
||||
Case "2"
|
||||
'POR FACTURAR
|
||||
Filtro = "NoFacturar <> NoFacturados"
|
||||
Case "3"
|
||||
'SIN FACTURA
|
||||
Filtro = "NoFacturar = 0 AND NoFacturados = 0"
|
||||
End Select
|
||||
GvDatos.DataSource = ObjOrdenesServicios.DtResultados.FiltraParametros(Filtro)
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
ObjOrdenesServicios.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Cells(0).Width = Unit.Pixel(50)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(200)
|
||||
e.Row.Cells(2).Width = Unit.Pixel(130)
|
||||
'e.Row.Cells(3).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(4).Width = Unit.Pixel(100)
|
||||
e.Row.Cells(5).Width = Unit.Pixel(100)
|
||||
'e.Row.Cells(6).Width = Unit.Pixel(100)
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
|
||||
e.Row.FCLiteral("LtlFolio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlFolio").Text & "</a>"
|
||||
e.Row.FCLabel("LtlCliente").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlCliente").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlFechaRecepcion").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "</a>"
|
||||
e.Row.FCLabel("LtlDescripcion").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlDescripcion").Text & "</a>"
|
||||
e.Row.FCLabel("LtlUsuarioRecibio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "</a>"
|
||||
e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "</a>"
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("RepOrdenesServicio_" & Now.ToShortDateString)
|
||||
End Sub
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Private Sub OrdenaDatos()
|
||||
If (GvDatos.Rows.Count > 0) Then
|
||||
GvDatos.UseAccessibleHeader = True
|
||||
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user