Procedimientos medicos cat detalles
This commit is contained in:
@@ -9371,6 +9371,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/RepIndicadoresPorProyecto.aspx".ToUpper(), 617)
|
||||
PaginaDict.Add("/Ventas/CatMedicos.aspx".ToUpper(), 1343)
|
||||
PaginaDict.Add("/Ventas/CatProcedimientos.aspx".ToUpper(), 1344)
|
||||
PaginaDict.Add("/Ventas/CatProcedimientoDetalle.aspx".ToUpper(), 1344)
|
||||
PaginaDict.Add("/Ventas/VentasMedicas.aspx".ToUpper(), 1345)
|
||||
|
||||
|
||||
|
||||
@@ -6149,9 +6149,16 @@ Public Class ClsVentas
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 547;") Then
|
||||
Alert("La Procedimiento no se pudo eliminar porque está siendo usado por un registro.", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
OnError("Ocurrió un error al eliminar el Procedimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
@@ -6159,6 +6166,135 @@ Public Class ClsVentas
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddProcedimientoProducto(CveProcedimiento As Integer, CvePS As Integer, Autogenerado As Boolean, Estatus As Boolean, CveUsuario As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Autogenerado", SqlDbType.Bit).Value = Autogenerado
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar el producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateProcedimientoProducto(CveProcedimientoProducto As Integer, CvePS As Integer, Autogenerado As Boolean, Estatus As Boolean, CveUsuario As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimientoProducto", SqlDbType.Int).Value = CveProcedimientoProducto
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@Autogenerado", SqlDbType.Bit).Value = Autogenerado
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function SincronizacionProcedimientoProducto(CveProcedimiento As Integer, CveVenta As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosSincronizacion")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al sincronizar los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetProcedimientoProducto(CveProcedimiento As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function RemoveProcedimientoProducto(CveProcedimientoProducto As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosProductosRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveProcedimientoProducto", SqlDbType.Int).Value = CveProcedimientoProducto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar los Productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
Public Function GetProcedimientoVentas(CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ProcedimientosVentasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las ventas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "IDisposable Support"
|
||||
|
||||
260
Ventas/CatProcedimientoDetalle.aspx
Normal file
260
Ventas/CatProcedimientoDetalle.aspx
Normal file
@@ -0,0 +1,260 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProcedimientoDetalle.aspx.vb" Inherits="Ventas_CatProcedimientoDetalle" %>
|
||||
|
||||
<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="E" runat="Server">
|
||||
<asp:Label runat="server" Text="Procedimiento" ID="LblProcedimiento"></asp:Label>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" >
|
||||
<ContentTemplate>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarProducto" CssClass="" data-toggle="tooltip" data-placement="left" Text="<i class='fa fa-plus'></i> Agregar Producto"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpDatos">
|
||||
<ContentTemplate>
|
||||
<ajax:TabContainer runat="server" ID="TabsRoles">
|
||||
|
||||
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Procedimiento">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpTabGeneral" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<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">General</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtProcedimiento" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVRol" runat="server" ControlToValidate="TxtProcedimiento" Display="None"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'Nombre del Procedimiento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtProcedimiento.ClientID.ToString()%>">Nombre Procedimiento:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="Div1" runat="server">
|
||||
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control make-switchsd"></asp:CheckBox>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="LblFechaAlta" runat="server">
|
||||
<label for="<%= LblFecha.ClientID.ToString()%>">Fecha:</label>
|
||||
<asp:Label ID="LblFecha" runat="server"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" id="LblUsuarioAlta" runat="server">
|
||||
<label for="<%= LblUsuario.ClientID.ToString()%>">Usuario:</label>
|
||||
<asp:Label ID="LblUsuario" runat="server"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabProductos" runat="server" HeaderText="Productos Relacionados">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTabProductos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row" align="right">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvProductos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvProductos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvProductos" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%"
|
||||
DataKeyNames="CveProcedimientoProducto,CveProcedimiento,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="EstatusStr" HeaderText="Estatus">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="AutogeneradoStr" HeaderText="Autogenerado">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing." ItemStyle-Width="80px" DataFormatString="{0:dd/MM/yyyy}">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="SerieFolioVenta" HeaderText="Serie Folio">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:BoundField DataField="FechaVenta" HeaderText="Fecha Venta" ItemStyle-Width="80px" DataFormatString="{0:dd/MM/yyyy}">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="100px" >
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditarProducto" runat="server" AlternateText="Editar" OnClick="LnkEditarProducto_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkEliminarProducto" OnClick="LnkEliminarProducto_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Eliminar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabVentas" runat="server" HeaderText="Ventas Relacionadas">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpTabVentas" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="row" align="right" style="max-width:50%">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvVentas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvVentas.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="row" style="max-width:50%">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvVentas" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn"
|
||||
data-sort="true" AutoGenerateColumns="False" Width="100%" DataKeyNames="" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField DataField="SerieFolio" HeaderText="SerieFolio">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
<ItemStyle Width="120px" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="TipoDocto" HeaderText="TipoDocto">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="80px" DataFormatString="{0:dd/MM/yyyy}">
|
||||
<ItemStyle HorizontalAlign="Center" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Hospital" HeaderText="Cliente">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Medico" HeaderText="Médico">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
|
||||
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
<br />
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<asp:Button runat="server" ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" />
|
||||
<asp:LinkButton runat="server" ID="LnkEliminar" Text="Eliminar" CssClass="btn btn-danger" OnClick="LnkEliminar_Click"
|
||||
AlternateText="Eliminar" CausesValidation="False" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si"/>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="ModalAgregar" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpAgregar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloAgregar" Text="" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto" CssClass="form-control input-sm select2me" CssStyle="width: 90%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" Width="" />
|
||||
<label style="line-height: 0.8" for="<%= DdlProducto.ClientID.ToString()%>">Producto: </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVProdcutoEstatus" visible="false" style="margin-top:15px!important">
|
||||
<asp:CheckBox runat="server" ID="ChkEstatusProducto" CssClass="form-control" />
|
||||
<label style="line-height: 0.8" for="<%= ChkEstatusProducto.ClientID.ToString()%>">Estatus: </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LkAgregarProducto" runat="server" CssClass="btn btn-primary" Text="Guardar" OnClick="LkAgregarProducto_Click"></asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
285
Ventas/CatProcedimientoDetalle.aspx.vb
Normal file
285
Ventas/CatProcedimientoDetalle.aspx.vb
Normal file
@@ -0,0 +1,285 @@
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Partial Class Ventas_CatProcedimientoDetalle
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
Private Property CveProcedimiento As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveProcedimiento") Is Nothing Then
|
||||
ViewState("CveProcedimiento") = -1
|
||||
End If
|
||||
|
||||
Return ViewState("CveProcedimiento").ToString.ToEntero
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProcedimiento") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveProcedimientoProducto As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveProcedimientoProducto") Is Nothing Then
|
||||
ViewState("CveProcedimientoProducto") = -1
|
||||
End If
|
||||
|
||||
Return ViewState("CveProcedimientoProducto").ToString.ToEntero
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProcedimientoProducto") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
CveProcedimiento = If(Request("CveProcedimiento") <> "", Request("CveProcedimiento").ToString.ToEntero, "-1".ToEntero)
|
||||
|
||||
If CveProcedimiento > 0 Then
|
||||
CargaDatos()
|
||||
CargaProductos()
|
||||
CargaVentas()
|
||||
End If
|
||||
|
||||
|
||||
DdlProducto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If Not DdlProducto.UsaWebService AndAlso CType(DdlProducto.DataSource, DataTable) Is Nothing Then
|
||||
DdlProducto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
|
||||
DdlProducto.DataBind()
|
||||
DdlProducto.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaVentas()
|
||||
|
||||
|
||||
Dim objVenta As New ClsVentas
|
||||
|
||||
If objVenta.GetProcedimientoVentas(CveProcedimiento, UsuarioActual.CveEmpresa) Then
|
||||
GvVentas.DataSource = objVenta.DtResultados
|
||||
End If
|
||||
|
||||
objVenta.Dispose()
|
||||
|
||||
GvVentas.DataBind()
|
||||
|
||||
UpTabVentas.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
|
||||
If CveProcedimiento > 0 Then
|
||||
|
||||
Dim DTProcedimiento As New DataTable
|
||||
Dim Objeto As New ClsVentas
|
||||
If Objeto.GetProcedimientos(CveProcedimiento, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
DTProcedimiento = Objeto.DtResultados
|
||||
|
||||
If DTProcedimiento.Rows.Count > 0 Then
|
||||
LblProcedimiento.Text = DTProcedimiento.FiltroPrimeroValor("Procedimiento")
|
||||
TxtProcedimiento.Text = DTProcedimiento.FiltroPrimeroValor("Procedimiento")
|
||||
|
||||
ChkEstatus.Checked = Boolean.Parse(DTProcedimiento.FiltroPrimeroValor("Estatus"))
|
||||
|
||||
LblFecha.Text = DTProcedimiento.FiltroPrimeroValor("FechaIng").ToDate.ToShortDateString
|
||||
LblUsuario.Text = DTProcedimiento.FiltroPrimeroValor("Usuario")
|
||||
Else
|
||||
Dim Liga As String = $"document.location.href=""/Ventas/CatProcedimientos.aspx"";"
|
||||
Alert("El Procedimiento solicitado no existe.", TipoMensaje.MsgAdvertencia, Liga)
|
||||
End If
|
||||
|
||||
Objeto.Dispose()
|
||||
End If
|
||||
Else
|
||||
|
||||
LblFechaAlta.Visible = False
|
||||
LblUsuarioAlta.Visible = False
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
Dim ProcesoOK = False
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
|
||||
If CveProcedimiento > 0 Then
|
||||
If ObjVentas.UpdateProcedimiento(CveProcedimiento, TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
'Else
|
||||
' If ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' ProcesoOK = True
|
||||
' End If
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If ProcesoOK Then
|
||||
Alert($"Procedimiento {If(CveProcedimiento > 0, "Actualizado", "Guardado")} Correctamente.")
|
||||
RegistraScript("$('#DVAgregarProcedimiento').modal('hide');")
|
||||
CargaDatos()
|
||||
CargaGlobal()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
'CveProcedimiento = GvRow.DataKey("CveProcedimiento").ToEntero
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ProcesoOK = False
|
||||
|
||||
If ObjVentas.RemoveProcedimiento(CveProcedimiento, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
If ProcesoOK Then
|
||||
CargaGlobal()
|
||||
Dim Liga As String = $"document.location.href=""/Ventas/CatProcedimientos.aspx"";"
|
||||
Alert("Procedimiento eliminando correctamente.", TipoMensaje.MsgInformacion, Liga)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaGlobal()
|
||||
GlobalDTProcedimientos(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregarProducto_Click() Handles LnkAgregarProducto.Click
|
||||
|
||||
limpiarModal()
|
||||
UpAgregar.Update()
|
||||
RegistraScript("$('#ModalAgregar').modal()")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub limpiarModal()
|
||||
|
||||
LtlTituloAgregar.Text = "Agregar Producto"
|
||||
CveProcedimientoProducto = -1
|
||||
DdlProducto.SelectedValue = "-1"
|
||||
DdlProducto.SelectedText = ""
|
||||
DVProdcutoEstatus.Visible = False
|
||||
UpAgregar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LkAgregarProducto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ProcesoOK As Boolean = False
|
||||
|
||||
Dim objVenta As New ClsVentas
|
||||
|
||||
If CveProcedimientoProducto > 0 Then
|
||||
|
||||
If objVenta.UpdateProcedimientoProducto(CveProcedimientoProducto, DdlProducto.SelectedValue.ToEntero, False, True, UsuarioActual.CveUsuario) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If objVenta.AddProcedimientoProducto(CveProcedimiento, DdlProducto.SelectedValue.ToEntero, False, True, UsuarioActual.CveUsuario) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
objVenta.Dispose()
|
||||
|
||||
If ProcesoOK Then
|
||||
RegistraScript("$('#ModalAgregar').modal('hide')")
|
||||
|
||||
Alert($"Producto {If(CveProcedimientoProducto > 0, "actualizado", "agregado")} correctamente.")
|
||||
|
||||
CargaProductos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaProductos()
|
||||
|
||||
Dim objVenta As New ClsVentas
|
||||
|
||||
If objVenta.GetProcedimientoProducto(CveProcedimiento, -1, UsuarioActual.CveEmpresa) Then
|
||||
GvProductos.DataSource = objVenta.DtResultados
|
||||
End If
|
||||
|
||||
objVenta.Dispose()
|
||||
|
||||
GvProductos.DataBind()
|
||||
|
||||
UpTabProductos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEditarProducto_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
CveProcedimientoProducto = GvRow.DataKey("CveProcedimientoProducto").ToEntero
|
||||
Dim CvePS As String = GvRow.DataKey("CvePS")
|
||||
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
|
||||
Dim Estatus As Boolean = Boolean.Parse(GvRow.DataKey("Estatus"))
|
||||
|
||||
DdlProducto.ddl.SelectedValueExist(CvePS)
|
||||
DdlProducto.txtText.Value = CodigoPS
|
||||
DdlProducto.txtValue.Value = CvePS
|
||||
ChkEstatusProducto.Checked = Estatus
|
||||
LtlTituloAgregar.Text = "Actualizar producto"
|
||||
|
||||
DVProdcutoEstatus.Visible = True
|
||||
UpAgregar.Update()
|
||||
|
||||
RegistraScript("$('#ModalAgregar').modal()")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarProducto_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveProcedimientoProductoEliminar = GvRow.DataKey("CveProcedimientoProducto").ToEntero
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ProcesoOK = False
|
||||
|
||||
If ObjVentas.RemoveProcedimientoProducto(CveProcedimientoProductoEliminar, UsuarioActual.CveEmpresa) Then
|
||||
ProcesoOK = True
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If ProcesoOK Then
|
||||
Alert("Producto eliminando correctamente.")
|
||||
CargaProductos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
@@ -34,44 +34,47 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div style="max-width:800px">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveProcedimiento, Procedimiento, Estatus, FechaIng, CveUsuario, CveEmpresa, Usuario, EstatusStr"
|
||||
EmptyDataText="No se encontraron Procedimientos Registrados" ToolTip="Listado de Procedimientos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Procedimiento" ItemStyle-HorizontalAlign="Left" >
|
||||
<div style="max-width: 800px">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveProcedimiento, Procedimiento, Estatus, FechaIng, CveUsuario, CveEmpresa, Usuario, EstatusStr"
|
||||
EmptyDataText="No se encontraron Procedimientos Registrados" ToolTip="Listado de Procedimientos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:HyperLinkField HeaderText="Procedimiento" DataNavigateUrlFields="CveProcedimiento" DataNavigateUrlFormatString="CatProcedimientoDetalle.aspx?CveProcedimiento={0}" DataTextField="Procedimiento" Target="_blank" />
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Procedimiento" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlProcedimiento" runat="server" Text='<%# Eval("Procedimiento") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("EstatusStr") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("EstatusStr") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="100px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="Edit_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="100px" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="Edit_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user