From 0ccf4fa1007a5bd051d39ff32552a71ee5060c40 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 9 Mar 2020 16:13:54 -0700 Subject: [PATCH] . --- App_Code/ClsPaginas.vb | 1 + RH/CatCursos.aspx.vb | 27 +++++---- Ventas/CatMetasVendedores.aspx | 91 +++++++++++++++++++++++++++++++ Ventas/CatMetasVendedores.aspx.vb | 61 +++++++++++++++++++++ Ventas/MetasVendedores.aspx.vb | 28 +++++----- Ventas/Ventas.aspx.vb | 15 +++++ 6 files changed, 199 insertions(+), 24 deletions(-) create mode 100644 Ventas/CatMetasVendedores.aspx create mode 100644 Ventas/CatMetasVendedores.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1e6327d03..8a0552af2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4667,6 +4667,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepVentasMensuales.aspx".ToUpper(), 720) PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722) + PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723) #End Region diff --git a/RH/CatCursos.aspx.vb b/RH/CatCursos.aspx.vb index e14828b38..5c6ac960e 100644 --- a/RH/CatCursos.aspx.vb +++ b/RH/CatCursos.aspx.vb @@ -642,28 +642,35 @@ Partial Class RH_CatCursos Dim RutaArchivo As String = UsuarioActual.Empresa.Ruta & "\Formatos\CursoInvitacion.docx" Dim RutaLogo As String = Path.Combine(UsuarioActual.Empresa.Ruta, "Logo.png") + Dim Contenido As String = "Buen día. Estimado(a) " & _Nombres & vbLf & vbLf & vbLf & vbLf & " Por medio de la presente, el departamento de Recursos Humanos de esta " & UsuarioActual.Empresa.Empresa & " le hace la cordial invitación para asistir al curso " & _Curso & " impartido por el capacitador " & _Capacitador & "." & vbLf & vbLf & vbLf & vbLf & "Esperamos contar con su asistencia." If Not File.Exists(RutaArchivo) Then RutaArchivo = $"{Server.MapPath("~")}\Empresas\Grales\Formatos\CursoInvitacion.docx" End If + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Curso", _Curso)) + params.Add(New ReportParameter("Contenido", Contenido)) + params.Add(New ReportParameter("Fecha", Today.ToString)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + Dim DtDatos As New DataTable + Return StreamPDF("Empresas/72/Formatos/CursoInvitacion.rdlc", DtDatos, params, "Invitación a curso", "PDF") - Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo) - Dim Tags As New List(Of TagsDocumentos) + 'Dim objGemBoxDocument As New clsGemBoxDocument(RutaArchivo) + 'Dim Tags As New List(Of TagsDocumentos) - Dim Contenido As String = "Buen día. Estimado(a) " & _Nombres & vbLf & " Por medio de la presente el departamento de recursos de esta empresa le hace la cordial invitación para asistir al curso " & _Curso & " impartido por el capacitador " & _Capacitador & ". Esperamos contar con su asistencia." - Tags.Add(New TagsDocumentos("{Curso}", _Curso)) - Tags.Add(New TagsDocumentos("{Contenido}", Contenido)) + 'Tags.Add(New TagsDocumentos("{Curso}", _Curso)) + 'Tags.Add(New TagsDocumentos("{Contenido}", Contenido)) - 'objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0) - objGemBoxDocument.SustituirTags(Tags) - objGemBoxDocument.GuardarStream() + ''objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0) + 'objGemBoxDocument.SustituirTags(Tags) + 'objGemBoxDocument.GuardarStream() - Return objGemBoxDocument.GetBytesDocumento + 'Return objGemBoxDocument.GetBytesDocumento End Function @@ -678,7 +685,7 @@ Partial Class RH_CatCursos With itemMail itemMail.ArchivoBinario = ArchivoBinario - itemMail.NombreArchivo = "Invitación.docx" + itemMail.NombreArchivo = "Invitación.pdf" End With diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx new file mode 100644 index 000000000..c6557b7a9 --- /dev/null +++ b/Ventas/CatMetasVendedores.aspx @@ -0,0 +1,91 @@ +<%@ Page Title="Catálogo de metas para vendedores" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMetasVendedores.aspx.vb" Inherits="CatMetasVendedores" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de metas para vendedores + + + + +
  • + Agregar Meta +
  • +
    +
    +
    + + + + + + + + + + + + + + diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb new file mode 100644 index 000000000..d4be887de --- /dev/null +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -0,0 +1,61 @@ +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class CatMetasVendedores + Inherits ClsPaginas + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaDatosModal() + End If + End Sub + + Private Sub CargaDatosModal() + DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) + DdlVendedores.DataBind() + DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1")) + + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarcas.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarcas.DataBind() + DdlMarcas.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacion.DataBind() + DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub + + Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + End Sub + + Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click + + If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then + Dim ObjVentas As New ClsVentas + If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, + TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero) Then + Alert("Se agregó la meta al vendedor") + Else + Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) + End If + Else + Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) + End If + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + ResetDatosSeleccionadosModal() + End Sub + + Private Sub ResetDatosSeleccionadosModal() + DdlVendedores.SelectedValue = "-1" + TxtFechaI.Text = "" + DdlMarcas.SelectedValue = "-1" + TxtMetaCantidad.Text = "" + TxtMetaImporte.Text = "" + UpModalTiposD.Update() + End Sub + +End Class diff --git a/Ventas/MetasVendedores.aspx.vb b/Ventas/MetasVendedores.aspx.vb index 686c58107..bab1cc28a 100644 --- a/Ventas/MetasVendedores.aspx.vb +++ b/Ventas/MetasVendedores.aspx.vb @@ -91,21 +91,21 @@ Partial Class MetasVendedores RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) End Sub - Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click + 'Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click - If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then - Dim ObjVentas As New ClsVentas - If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal) Then - Alert("Se agregó la meta al vendedor") - Else - Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) - End If - Else - Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) - End If - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) - ResetDatosSeleccionadosModal() - End Sub + ' If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then + ' Dim ObjVentas As New ClsVentas + ' If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal) Then + ' Alert("Se agregó la meta al vendedor") + ' Else + ' Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) + ' End If + ' Else + ' Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) + ' End If + ' RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) + ' ResetDatosSeleccionadosModal() + 'End Sub Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click CargarDatosReporte() diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 3509500ee..42dcf3995 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -22430,6 +22430,11 @@ Partial Class Ventas Dim PedidoContrato As String = "" Dim EnvioContacto As String = "" Dim EnvioDireccion As String = "" + Dim EnviarOficina As String = "" + Dim EnviarCalle As String = "" + Dim EnviarColonia As String = "" + Dim EnvioCiudad As String = "" + Dim EnvioTel As String = "" Dim Guia As String = "" If ObjInventario.GetPaqueteriaGuia(-1, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then If ObjInventario.DtResultados.Rows.Count > 0 Then @@ -22442,6 +22447,11 @@ Partial Class Ventas PedidoContrato = ObjVentas.DtResultados.Rows(0)("PedidoContrato").ToString EnvioContacto = ObjVentas.DtResultados.Rows(0)("EnvioContacto").ToString EnvioDireccion = $"{ObjVentas.DtResultados.Rows(0)("EnvioDireccion").ToString}, NO. EXT: {ObjVentas.DtResultados.Rows(0)("EnvioNoExt").ToString}, COLONIA: {ObjVentas.DtResultados.Rows(0)("EnvioColonia").ToString}, CP: {ObjVentas.DtResultados.Rows(0)("EnvioCP").ToString}" + EnviarOficina = ObjVentas.DtResultados.Rows(0)("EnvioDepartamento").ToString + EnviarCalle = ObjVentas.DtResultados.Rows(0)("EnvioDireccion").ToString + EnviarColonia = ObjVentas.DtResultados.Rows(0)("EnvioColonia").ToString + EnvioCiudad = ObjVentas.DtResultados.Rows(0)("EnvioCiudad").ToString + EnvioTel = ObjVentas.DtResultados.Rows(0)("EnvioTel").ToString End If End If Dim Dt As DataTable = Nothing @@ -22460,6 +22470,11 @@ Partial Class Ventas params.Add(New ReportParameter("PedidoContrato", PedidoContrato)) params.Add(New ReportParameter("EnvioDireccion", EnvioDireccion)) params.Add(New ReportParameter("Guia", Guia)) + params.Add(New ReportParameter("EnviarOficina", EnviarOficina)) + params.Add(New ReportParameter("EnviarCalle", EnviarCalle)) + params.Add(New ReportParameter("EnviarColonia", EnviarColonia)) + params.Add(New ReportParameter("EnvioCiudad", EnvioCiudad)) + params.Add(New ReportParameter("EnvioTel", EnvioTel)) ImprimirPDF("Empresas/Grales/Formatos/Telcel.rdlc", Dt, params, String.Format("Formato RADIO MOVIL DIPSA S.A DE C.V. -{0}", Now.ToDateTime.ToShortDateString)) End If End Sub