Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -87,6 +87,7 @@ Public Class ClsOIEventos
|
|||||||
End Property
|
End Property
|
||||||
#Region "Propiedades de la tabla OI_Eventos"
|
#Region "Propiedades de la tabla OI_Eventos"
|
||||||
Public Property CveEvento As Integer
|
Public Property CveEvento As Integer
|
||||||
|
Public Property CveIndicador As Integer
|
||||||
Public Property CveTipoEvento As Integer
|
Public Property CveTipoEvento As Integer
|
||||||
Public Property Folio As Integer
|
Public Property Folio As Integer
|
||||||
Public Property TipoEvento As String
|
Public Property TipoEvento As String
|
||||||
@@ -965,7 +966,7 @@ Public Class ClsOIEventos
|
|||||||
Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1,
|
Optional CveOS As Integer = -1, Optional CveOC As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedor As Integer = -1,
|
||||||
Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
Optional CveCompra As Integer = -1, Optional CveVenta As Integer = -1, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||||
Optional CveMovimientoAlmacen As Integer = -1, Optional CorreoExterno As String = "", Optional CveTableroLista As Integer = -1, Optional Lugar As String = "",
|
Optional CveMovimientoAlmacen As Integer = -1, Optional CorreoExterno As String = "", Optional CveTableroLista As Integer = -1, Optional Lugar As String = "",
|
||||||
Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1) As Boolean
|
Optional Asistencia As String = "", Optional Duracion As String = "", Optional CveAcercamiento As Integer = -1, Optional CveIndicador As Integer = -1) As Boolean
|
||||||
Dim retorno As Boolean = False
|
Dim retorno As Boolean = False
|
||||||
|
|
||||||
Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing
|
Dim xmlMiembros As System.Xml.Linq.XDocument = Nothing
|
||||||
@@ -1028,6 +1029,7 @@ Public Class ClsOIEventos
|
|||||||
.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
|
.Add("@Lugar", SqlDbType.VarChar).Value = Lugar
|
||||||
.Add("@CveTableroLista", SqlDbType.VarChar).Value = CveTableroLista
|
.Add("@CveTableroLista", SqlDbType.VarChar).Value = CveTableroLista
|
||||||
.Add("@CveAcercamiento", SqlDbType.VarChar).Value = CveAcercamiento
|
.Add("@CveAcercamiento", SqlDbType.VarChar).Value = CveAcercamiento
|
||||||
|
.Add("@CveIndicador", SqlDbType.VarChar).Value = CveIndicador
|
||||||
|
|
||||||
|
|
||||||
'.Add("@mailPara", SqlDbType.VarChar).Direction = ParameterDirection.Output
|
'.Add("@mailPara", SqlDbType.VarChar).Direction = ParameterDirection.Output
|
||||||
@@ -3216,8 +3218,66 @@ Public Class ClsOIEventos
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Region "I N D I C A D O R E S "
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
Public Function AddIndicador(Indicador As Integer, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
CveIndicador = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Dir_IndicadorAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@Indicador", SqlDbType.Int).Value = Indicador
|
||||||
|
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveIndicador", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
CveIndicador = SqlAdapter.SelectCommand.Parameters("@CveIndicador").Value.ToString().ToEntero()
|
||||||
|
If CveIndicador > 0 Then
|
||||||
|
Retorno = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function UpdateIndicador(CveIndicador As Integer, Valor As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Dir_IndicadorUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveIndicador", SqlDbType.Int).Value = CveIndicador
|
||||||
|
.Add("@Valor", SqlDbType.Int).Value = Valor
|
||||||
|
.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 actualizar el indicador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
' IDisposable
|
' IDisposable
|
||||||
|
|||||||
@@ -10518,6 +10518,7 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/CatDocumentoSubCategoria.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/Documentos.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OI/DocumentoDetalle.aspx".ToUpper(), -1)
|
||||||
|
PaginaDict.Add("/OI/RepIndicadoresEMD.aspx".ToUpper(), 1348)
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Planeacion"
|
#Region "Planeacion"
|
||||||
PaginaDict.Add("/Planeacion/CatSucursales.aspx".ToUpper(), 17)
|
PaginaDict.Add("/Planeacion/CatSucursales.aspx".ToUpper(), 17)
|
||||||
|
|||||||
@@ -246,6 +246,29 @@
|
|||||||
<asp:LinkButton ID="LnkAddTtemaB" OnClick="LnkAddTtemaB_Click" runat="server" CssClass="btn btn-default" Style="margin-top: 15px;"><i class="fa fa-plus"></i></asp:LinkButton>
|
<asp:LinkButton ID="LnkAddTtemaB" OnClick="LnkAddTtemaB_Click" runat="server" CssClass="btn btn-default" Style="margin-top: 15px;"><i class="fa fa-plus"></i></asp:LinkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row" runat="server" id="DvIndicador" visible ="false">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group form-md-line-input">
|
||||||
|
<asp:DropDownList ID="DdlIndicador" runat="server" CssClass="form-control select2me input-sm" Width="100%">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="1" class="itembaja">Programación de bolsa aprobada en tiempo</asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:Label runat="server" AssociatedControlID="DdlPrioridad">Indicador:</asp:Label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group form-md-line-input">
|
||||||
|
|
||||||
|
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control select2me input-sm" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="100%" AppendDataBoundItems="true">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<asp:Label runat="server" ID="LblSubProyecto" AssociatedControlID="DdlSubProyecto">:</asp:Label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
<asp:TextBox ID="txtCveEvento" CssClass="hidden txtCveEvento" runat="server"></asp:TextBox>
|
<asp:TextBox ID="txtCveEvento" CssClass="hidden txtCveEvento" runat="server"></asp:TextBox>
|
||||||
|
|||||||
@@ -48,6 +48,21 @@ public partial class OI_Proyecto : ClsPaginas
|
|||||||
DdlTema.DataBind();
|
DdlTema.DataBind();
|
||||||
DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
|
|
||||||
|
CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto, "");
|
||||||
|
|
||||||
|
if (DdlSubProyecto.Items.Count > 0)
|
||||||
|
{
|
||||||
|
DdlSubProyecto.Items.RemoveAt(0);
|
||||||
|
DdlSubProyecto.Items.Insert(0, new ListItem("Seleccione","-1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (UsuarioActual.CveEmpresa == 13)
|
||||||
|
{
|
||||||
|
DvIndicador.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +199,7 @@ public partial class OI_Proyecto : ClsPaginas
|
|||||||
bool Continuar = false;
|
bool Continuar = false;
|
||||||
int Folio = -1;
|
int Folio = -1;
|
||||||
int CveEvento = -1;
|
int CveEvento = -1;
|
||||||
|
int CveIndicador = -1;
|
||||||
|
|
||||||
if (cveUsuarioDe <= 0)
|
if (cveUsuarioDe <= 0)
|
||||||
{
|
{
|
||||||
@@ -193,8 +209,13 @@ public partial class OI_Proyecto : ClsPaginas
|
|||||||
if (cveUsuarioPara <= 0)
|
if (cveUsuarioPara <= 0)
|
||||||
{
|
{
|
||||||
errorMessage = "No se selecciono el miembro 'Para'";
|
errorMessage = "No se selecciono el miembro 'Para'";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(DdlIndicador.SelectedValue.ToEntero() > 0 && DdlSubProyecto.SelectedValue.ToEntero() <0)
|
||||||
|
{
|
||||||
|
errorMessage = "Si agrega un indicador debe de agregar el sub proyecto.";
|
||||||
|
}
|
||||||
|
|
||||||
if (errorMessage.Length == 0)
|
if (errorMessage.Length == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -203,14 +224,44 @@ public partial class OI_Proyecto : ClsPaginas
|
|||||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||||
{
|
{
|
||||||
objOI.IniciaTransacSQL();
|
objOI.IniciaTransacSQL();
|
||||||
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEventoB);
|
|
||||||
|
|
||||||
|
if (DdlIndicador.SelectedValue.ToEntero() > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (objOI.AddIndicador(DdlIndicador.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa) && objOI.CveIndicador > 0)
|
||||||
|
{
|
||||||
|
CveIndicador = objOI.CveIndicador;
|
||||||
|
Continuar = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Continuar = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Continuar = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (Continuar)
|
||||||
|
{
|
||||||
|
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEventoB, CveIndicador: CveIndicador);
|
||||||
|
}
|
||||||
|
|
||||||
CveEvento = objOI.CveEvento;
|
CveEvento = objOI.CveEvento;
|
||||||
Folio = objOI.Folio;
|
Folio = objOI.Folio;
|
||||||
if (CveEvento == 0)
|
|
||||||
|
if (CveEvento > 0)
|
||||||
|
{
|
||||||
|
Continuar = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Continuar = false;
|
Continuar = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Continuar)
|
if (Continuar)
|
||||||
{
|
{
|
||||||
objOI.Commit();
|
objOI.Commit();
|
||||||
@@ -249,13 +300,17 @@ public partial class OI_Proyecto : ClsPaginas
|
|||||||
txtFechaI.Text = "";
|
txtFechaI.Text = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert(errorMessage,ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void BtnopenmodalClickGant_Click(object sender, EventArgs e)
|
protected void BtnopenmodalClickGant_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
SetUsuarios();
|
||||||
RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto));
|
RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarProyecto));
|
||||||
RCveEventoB = txtCveEvento.Text.ToEntero();
|
RCveEventoB = txtCveEvento.Text.ToEntero();
|
||||||
}
|
}
|
||||||
|
|||||||
306
OI/RepIndicadoresEMD.aspx
Normal file
306
OI/RepIndicadoresEMD.aspx
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
<%@ Page Title="Reporte de Indicadores" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadoresEMD.aspx.vb" Inherits="OI_RepIndicadoresEMD" %>
|
||||||
|
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||||
|
<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
|
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
Reporte de Comisiones
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Reporte de Comisiones
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Always">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton runat="server" ID="LnkComisiones" OnClick="LnkComisiones_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones"></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||||
|
</Triggers>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional" >
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||||
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
|
<div class="tools">
|
||||||
|
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||||
|
<a href="javascript:;" class="expand"></a>
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
<div class="row" style="height: 32px;">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-1 truncate">
|
||||||
|
Fecha Inicio:
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1 truncate">
|
||||||
|
Fecha Fin:
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1" style="min-width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="col-md-1 ">Médico:</label>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<asp:DropDownList ID="DdlMedico" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="col-md-1 ">Vendedor:</label>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<asp:DropDownList ID="DdlVendedor" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="100%">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="col-md-1 ">Técnico:</label>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<asp:DropDownList ID="DdlUsuarioAtendio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveUsuario" Width="100%">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body" style="display: none">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
<ajax:TabContainer runat="server" ID="Tabs">
|
||||||
|
|
||||||
|
<ajax:TabPanel ID="TabComisiones" runat="server" HeaderText="Comisiones" ClientIDMode="Static">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||||
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" 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="GvDatos" runat="server" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="CveVenta,SerieFolio,Hospital,Medico,Especialidad,FechaCirugia,Procedimiento,Codigo,PU,Cantidad,Total,CveVendedor,Vendedor,Nombre,ComisionMedico,ComisionVendedor,ComisionTecnico"
|
||||||
|
data-sort="true"
|
||||||
|
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
|
||||||
|
<asp:BoundField HeaderText="Folio" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Nombre Hospital" DataField="Hospital" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Especialidad" DataField="Especialidad" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Fecha Hora Cirugia" DataField="FechaCirugia" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:dd/MM/yyyy hh:mm}" />
|
||||||
|
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Código Producto" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Nombre Del Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Precio Unitario" DataField="PU" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Cantidad Utilizada" DataField="Cantidad" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Monto Venta Total" DataField="Total" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Comisión Vendedor" DataField="ComisionVendedor" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
|
<asp:BoundField HeaderText="Técnico" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Comisión Técnico" DataField="ComisionTecnico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
|
<asp:BoundField HeaderText="Educación Médica" DataField="ComisionMedico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
<ajax:TabPanel ID="TabEspeciales" runat="server" HeaderText="Especiales" ClientIDMode="Static">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:UpdatePanel ID="UpDatosEspeciales" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" id="TxtBusquedaEspecial" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEspecial','{0}')", GvDatosEspeciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEspecial','{0}')", GvDatosEspeciales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<asp:GridView ID="GvDatosEspeciales" runat="server" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames=""
|
||||||
|
data-sort="true"
|
||||||
|
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField HeaderText="Com. Médico" DataField="ComisionMedico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
|
||||||
|
<asp:BoundField HeaderText="Com. Gerente" DataField="ComisionGerente" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
|
||||||
|
<asp:BoundField HeaderText="Com. Vendedor" DataField="ComisionVendedor" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
|
||||||
|
<asp:BoundField HeaderText="Com. Técnico" DataField="ComisionTecnico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
|
||||||
|
<asp:BoundField HeaderText="Fecha de Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="80px" />
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
</ajax:TabContainer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DvModalComisiones" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog" style="width: 900px;">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpDvModalComisiones" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="Literal1" runat="server">Comisiones</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||||
|
<input type="text" id="TxtBusquedaComiciones" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisiones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisiones.ClientID) %>" style="margin-top: -3px;" 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="GvComisiones" runat="server" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="CvePS,ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico"
|
||||||
|
data-sort="true" OnRowDataBound="GvComisiones_RowDataBound"
|
||||||
|
EmptyDataText="No se encontraron Comisiones" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlCodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Médico" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtComisionMedico" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionMedico")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this)" AutoComplete="off"></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="% Gerente" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtComisionGerente" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionGerente")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this);validaPorcentaje(this);" AutoComplete="off" ></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="% Vendedor" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtComisionVendedor" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionVendedor")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this);validaPorcentaje(this);" AutoComplete="off" ></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="% Técnico" ItemStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtComisionTecnico" Width="75px" runat="server" Text='<%# String.Format("{0:#.00}", Eval("ComisionTecnico")) %>' Style="text-align: right;" onkeyup="FormatoMoneda(this);validaPorcentaje(this);" AutoComplete="off" ></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnGuardarComisiones" OnClick="BtnGuardarComisiones_Click" runat="server" class="btn btn-success" Text="Guardar" ValidationGroup="GrpGuardarEspecialidad" />
|
||||||
|
<button id="BtnCerrar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function validaPorcentaje(textbox) {
|
||||||
|
|
||||||
|
var valor = parseFloat(textbox.value.replace(/,/g, ''));
|
||||||
|
|
||||||
|
if (valor > 100) {
|
||||||
|
|
||||||
|
textbox.value = '100';
|
||||||
|
} else if ( isNaN(valor) || valor == 0) {
|
||||||
|
|
||||||
|
textbox.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
251
OI/RepIndicadoresEMD.aspx.vb
Normal file
251
OI/RepIndicadoresEMD.aspx.vb
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
Option Explicit On
|
||||||
|
Option Strict On
|
||||||
|
|
||||||
|
Imports System.Data
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
|
||||||
|
Partial Class OI_RepIndicadoresEMD
|
||||||
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Property DTDatos As DataTable
|
||||||
|
Get
|
||||||
|
If ViewState("DTDatos") Is Nothing Then
|
||||||
|
ViewState("DTDatos") = New DataTable
|
||||||
|
End If
|
||||||
|
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||||
|
End Get
|
||||||
|
Set(value As DataTable)
|
||||||
|
ViewState("DTDatos") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
|
If Not Page.IsPostBack Then
|
||||||
|
|
||||||
|
Dim FechaInicial As Date = New Date(10)
|
||||||
|
|
||||||
|
txtFechaI.Text = Now.FirstDayOfMonth.ToString("dd/MM/yyyy")
|
||||||
|
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
|
||||||
|
CargaCombos()
|
||||||
|
CargaDatos()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaCombos()
|
||||||
|
|
||||||
|
|
||||||
|
'If UsuarioActual.Empresa.Funcionalidad(302) = "1" AndAlso DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then
|
||||||
|
' DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros(String.Format("VendedorTipo IN (1,4) AND (CveSubProyecto IS NULL OR CveSubProyecto = {0})", DdlSubProyectoDatos.SelectedValue))
|
||||||
|
'Else
|
||||||
|
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1")
|
||||||
|
'End If
|
||||||
|
DdlVendedor.DataBind()
|
||||||
|
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
|
||||||
|
|
||||||
|
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||||
|
DdlMedico.DataBind()
|
||||||
|
DdlMedico.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
|
||||||
|
DdlUsuarioAtendio.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
|
||||||
|
DdlUsuarioAtendio.DataBind()
|
||||||
|
DdlUsuarioAtendio.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub CargaDatos()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LnkExportar.Visible = False
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
|
||||||
|
If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 1) Then
|
||||||
|
GvDatos.DataSource = ObjVentas.DtResultados
|
||||||
|
|
||||||
|
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
|
LnkExportar.Visible = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
GvDatos.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
GvDatos.DataBind()
|
||||||
|
|
||||||
|
UpDatos.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub CargaDatosEspeciales()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LnkExportar.Visible = False
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
|
||||||
|
If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 2) Then
|
||||||
|
GvDatosEspeciales.DataSource = ObjVentas.DtResultados
|
||||||
|
|
||||||
|
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
|
LnkExportar.Visible = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
GvDatosEspeciales.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
GvDatosEspeciales.DataBind()
|
||||||
|
|
||||||
|
UpDatosEspeciales.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
If Tabs.ActiveTabIndex = 0 Then
|
||||||
|
CargaDatos()
|
||||||
|
Else
|
||||||
|
CargaDatosEspeciales()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "EXCEL"
|
||||||
|
|
||||||
|
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||||
|
|
||||||
|
|
||||||
|
Dim SbFiltros As New StringBuilder()
|
||||||
|
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
|
||||||
|
|
||||||
|
|
||||||
|
If Tabs.ActiveTabIndex = 0 Then
|
||||||
|
GvDatos.Columns(10).Visible = False
|
||||||
|
GvDatos.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||||
|
GvDatos.Columns(10).Visible = True
|
||||||
|
Else
|
||||||
|
GvDatosEspeciales.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones Especiales", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkComisiones_Click(sender As Object, e As EventArgs)
|
||||||
|
CargaComisiones()
|
||||||
|
RegistraScript("$('#DvModalComisiones').modal('show');")
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaComisiones()
|
||||||
|
DTDatos = New DataTable
|
||||||
|
GvComisiones.DataSource = Nothing
|
||||||
|
|
||||||
|
Dim objVentas As New ClsVentas
|
||||||
|
|
||||||
|
If objVentas.GetComisionesMedicas(UsuarioActual.CveEmpresa) Then
|
||||||
|
GvComisiones.DataSource = objVentas.DtResultados
|
||||||
|
DTDatos = objVentas.DtResultados
|
||||||
|
End If
|
||||||
|
|
||||||
|
objVentas.Dispose()
|
||||||
|
|
||||||
|
GvComisiones.DataBind()
|
||||||
|
|
||||||
|
UpDvModalComisiones.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub BtnGuardarComisiones_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim objVentas As New ClsVentas
|
||||||
|
objVentas.IniciaTransacSQL()
|
||||||
|
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
|
||||||
|
For Each GvRow As GridViewRow In GvComisiones.Rows
|
||||||
|
|
||||||
|
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
|
||||||
|
Dim ComisionMedicoDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionMedico", $"CvePS = {CvePS} ").ToDecimal
|
||||||
|
Dim ComisionVendedorDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionVendedor", $"CvePS = {CvePS} ").ToDecimal
|
||||||
|
Dim ComisionTecnicoDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionTecnico", $"CvePS = {CvePS} ").ToDecimal
|
||||||
|
Dim ComisionGerenteDT As Decimal = DTDatos.FiltroPrimeroValor("ComisionGerente", $"CvePS = {CvePS} ").ToDecimal
|
||||||
|
|
||||||
|
Dim ComisionMedicoGV As Decimal = GvRow.FCTextBox("TxtComisionMedico").Text.ToDecimal
|
||||||
|
Dim ComisionGerenteGV As Decimal = (GvRow.FCTextBox("TxtComisionGerente").Text.ToDecimal / 100).RoundSQL(4)
|
||||||
|
Dim ComisionVendedorGV As Decimal = (GvRow.FCTextBox("TxtComisionVendedor").Text.ToDecimal / 100).RoundSQL(4)
|
||||||
|
Dim ComisionTecnicoGV As Decimal = (GvRow.FCTextBox("TxtComisionTecnico").Text.ToDecimal / 100).RoundSQL(4)
|
||||||
|
|
||||||
|
|
||||||
|
If ComisionMedicoDT <> ComisionMedicoGV Or ComisionVendedorDT <> ComisionVendedorGV Or ComisionTecnicoDT <> ComisionTecnicoGV Or ComisionGerenteDT <> ComisionGerenteGV Then
|
||||||
|
If Not objVentas.AddUpdateComisionesMedicas(GvRow.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, ComisionMedicoGV, ComisionVendedorGV, ComisionTecnicoGV, ComisionGerenteGV) Then
|
||||||
|
TieneError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
If TieneError Then
|
||||||
|
objVentas.RollBack()
|
||||||
|
Else
|
||||||
|
objVentas.Commit()
|
||||||
|
Alert("Comisiones Actualizadas correctamente")
|
||||||
|
End If
|
||||||
|
|
||||||
|
objVentas.Dispose()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvComisiones_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
'ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico"
|
||||||
|
|
||||||
|
If e.Row.DataKey("ComisionMedico").ToDecimal = 0 Then
|
||||||
|
e.Row.FCTextBox("TxtComisionMedico").Text = ""
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtComisionMedico").Text = e.Row.DataKey("ComisionMedico").ToDecimal.ToString("###.00")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If e.Row.DataKey("ComisionGerente").ToDecimal = 0 Then
|
||||||
|
e.Row.FCTextBox("TxtComisionGerente").Text = ""
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtComisionGerente").Text = (e.Row.DataKey("ComisionGerente").ToDecimal * 100).ToString("###.00")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If e.Row.DataKey("ComisionVendedor").ToDecimal = 0 Then
|
||||||
|
e.Row.FCTextBox("TxtComisionVendedor").Text = ""
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtComisionVendedor").Text = (e.Row.DataKey("ComisionVendedor").ToDecimal * 100).ToString("###.00")
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DataKey("ComisionTecnico").ToDecimal = 0 Then
|
||||||
|
e.Row.FCTextBox("TxtComisionTecnico").Text = ""
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtComisionTecnico").Text = (e.Row.DataKey("ComisionTecnico").ToDecimal * 100).ToString("###.00")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
Reference in New Issue
Block a user