diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs
index 1eef821ff..07844b84b 100644
--- a/CRM/RepAcercamientos.aspx.cs
+++ b/CRM/RepAcercamientos.aspx.cs
@@ -6,6 +6,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
+using Microsoft.Reporting.WebForms;
public partial class CRM_RepAcercamientos : ClsPaginas
{
@@ -22,6 +23,18 @@ public partial class CRM_RepAcercamientos : ClsPaginas
ViewState["CveVendedor"] = value;
}
}
+ private DataTable DtDatos
+ {
+ get
+ {
+ return (ViewState["DtDatos"] == null ? null : (DataTable)ViewState["DtDatos"]);
+ }
+
+ set
+ {
+ ViewState["DtDatos"] = value;
+ }
+ }
#endregion
protected void Page_Load(object sender, EventArgs e)
@@ -49,6 +62,7 @@ public partial class CRM_RepAcercamientos : ClsPaginas
if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero()))
{
GVDatos.DataSource = ObjCRM.DtResultados;
+ DtDatos = ObjCRM.DtResultados;
GVDatos.DataBind();
}
@@ -78,13 +92,43 @@ public partial class CRM_RepAcercamientos : ClsPaginas
//CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL
TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString();
- //TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString();
+ TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString();
DdlPS.setEsWebService(true);
-
+ DdlPS.SelectedValue = "-1";
+ DdlPS.SelectedText = "Seleccione";
DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa);
DdlGiroClasificacion.DataSource = dtGiroClasificaciones;
DdlGiroClasificacion.DataBind();
DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1"));
}
#endregion
+
+ protected void LnkPDF_Click(object sender, EventArgs e)
+ {
+ Imprimir("PDF");
+ }
+
+ protected void LnkExcel_Click(object sender, EventArgs e)
+ {
+ Imprimir("Excel");
+ }
+
+ private void Imprimir(string formato)
+ {
+ string VendedorFiltro = String.Format("
Vendedor: {0} ", (DdlVendedor.SelectedValue != "-1" ? DdlVendedor.SelectedItem.Text : "Todos"));
+ string ProductoServicioFiltro = String.Format("
Producto Servicio: {0} ", (DdlPS.SelectedValue != "-1" ? DdlPS.SelectedText : "Todos"));
+ string GiroFiltro = String.Format("
Giro: {0} ", (DdlGiroClasificacion.SelectedValue != "-1" ? DdlGiroClasificacion.SelectedItem.Text : "Todos"));
+ string FechaInicioFiltro = String.Format("
Fecha Inicio: {0} ", TxtFechaInicio.Text);
+ string FechaFinFiltro = String.Format("
Fecha Fin: {0} ", TxtFechaFin.Text);
+
+ string Filtros = String.Format("{0}{1}{2}{3}{4}", VendedorFiltro, FechaInicioFiltro, FechaFinFiltro, ProductoServicioFiltro, GiroFiltro);
+
+ List
@params = new List();
+ @params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
+ @params.Add(new ReportParameter("LogoPath", new Uri(Server.MapPath(string.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri));
+ @params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
+ @params.Add(new ReportParameter("AgrupadoPor", Filtros));
+
+ ImprimirPDF("Empresas/Grales/Formatos/RepAcercamientos.rdlc", DtDatos, @params, "Reporte de Acercamientos", formato);
+ }
}
\ No newline at end of file
diff --git a/CRM/RepAcercamientosProcesos.aspx.cs b/CRM/RepAcercamientosProcesos.aspx.cs
index 59588035e..241ff91d7 100644
--- a/CRM/RepAcercamientosProcesos.aspx.cs
+++ b/CRM/RepAcercamientosProcesos.aspx.cs
@@ -393,7 +393,7 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
doc.Add(header);
Paragraph Filtros = this.filtrosDelReporte();
doc.Add(Filtros);
- PdfPTable table = this.convertirReporteATabla();
+ PdfPTable table = this.convertirReporteATabla(doc);
doc.Add(table);
doc.Close();
@@ -533,12 +533,15 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
return Filtros;
}
- private PdfPTable convertirReporteATabla()
+ private PdfPTable convertirReporteATabla(Document doc)
{
int numeroDeColumnas = GVRepAcercamientosEtapas.Columns.Count;
PdfPTable table = new PdfPTable(numeroDeColumnas);
table.WidthPercentage = 100f;
+ float[] anchoColumnas = this.ColumnasWidth();
+ table.SetWidths(anchoColumnas);
+
BaseColor headerBackGroundColor = new BaseColor(240,240,240);
Font fuente = FontFactory.GetFont("Arial", 9f);
@@ -568,6 +571,29 @@ public partial class CRM_RepAcercamientosProcesos : ClsPaginas
return table;
}
+ private float[] ColumnasWidth()
+ {
+ int CantidadColumnas = GVRepAcercamientosEtapas.Columns.Count;
+ float[] ColumnsWidth = new float[CantidadColumnas];
+
+ int cursor = 0;
+ DataControlFieldCollection ColumnsCollection = GVRepAcercamientosEtapas.Columns;
+ foreach (DataControlField columns in ColumnsCollection)
+ {
+ if (columns.HeaderText == "Total")
+ {
+ ColumnsWidth[cursor] = 20f;
+ }else
+ {
+ ColumnsWidth[cursor] = 80f;
+ }
+
+ cursor++;
+ }
+
+ return ColumnsWidth;
+ }
+
protected void LnkExcel_Click(object sender, EventArgs e)
{
GVRepAcercamientosEtapas.ExportToExcelGembox("Reporte de Rechazos de Acercamiento", UsuarioActual, "", "", "Reporte de Rechazos de Acercamiento", "", -1);
diff --git a/CRM/RepAcercamientosRechazos.aspx.cs b/CRM/RepAcercamientosRechazos.aspx.cs
index 2ab4f2746..ea1d906c8 100644
--- a/CRM/RepAcercamientosRechazos.aspx.cs
+++ b/CRM/RepAcercamientosRechazos.aspx.cs
@@ -520,6 +520,9 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
PdfPTable table = new PdfPTable(numeroDeColumnas);
table.WidthPercentage = 100f;
+ //float[] anchoColumnas = this.ColumnasWidth();
+ //table.SetWidths(anchoColumnas);
+
BaseColor headerBackGroundColor = new BaseColor(240, 240, 240);
Font fuente = FontFactory.GetFont("Arial", 9f);
@@ -550,6 +553,30 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas
return table;
}
+ private float[] ColumnasWidth()
+ {
+ int CantidadColumnas = GVRepAcercamientosEtapas.Columns.Count;
+ float[] ColumnsWidth = new float[CantidadColumnas];
+
+ int cursor = 0;
+ DataControlFieldCollection ColumnsCollection = GVRepAcercamientosEtapas.Columns;
+ foreach (DataControlField columns in ColumnsCollection)
+ {
+ //if (columns.HeaderText == "Total")
+ //{
+ // ColumnsWidth[cursor] = 20f;
+ //}
+ //else
+ //{
+ // ColumnsWidth[cursor] = 80f;
+ //}
+
+ cursor++;
+ }
+
+ return ColumnsWidth;
+ }
+
protected void LnkExcel_Click(object sender, EventArgs e)
{
GVRepAcercamientosEtapas.ExportToExcelGembox("Reporte de Rechazos de Acercamiento", UsuarioActual, "", "", "Reporte de Rechazos de Acercamiento", "", -1);
diff --git a/Prospeccion/PopUpBuscarProspectos.aspx b/Prospeccion/PopUpBuscarProspectos.aspx
index d1038fbd9..936bffa8e 100644
--- a/Prospeccion/PopUpBuscarProspectos.aspx
+++ b/Prospeccion/PopUpBuscarProspectos.aspx
@@ -21,16 +21,14 @@
Filtros para búsqueda |
- | Nombre: |
- |
Empresa: |
|
+ RFC: |
+ |
|
- Teléfono/Celular:
|
- |
@@ -44,52 +42,52 @@
-
+
| Número de registros encontrados: |
-
-
+
+
-
+
-
+
-
+
-
+
- <%----%>
-
+
-
+
- <%----%>
-
+
-
+
- <%----%>
-
+
-
+
- <%----%>
- <%--
- --%>
-
+
-
+
- <%----%>
+ <%----%>
+ <%----%>
+ <%----%>
+ <%----%>
+ <%----%>
+ <%----%>
diff --git a/Prospeccion/PopUpBuscarProspectos.aspx.vb b/Prospeccion/PopUpBuscarProspectos.aspx.vb
index 971daf4b0..90b755c73 100644
--- a/Prospeccion/PopUpBuscarProspectos.aspx.vb
+++ b/Prospeccion/PopUpBuscarProspectos.aspx.vb
@@ -16,7 +16,7 @@ Partial Class PopUpBuscarProspectos
CType(Me.Master, BaseMasterPage).EsPopup = True
CType(Me.Master, BaseMasterPage).PopupWidth = 800
RegistraScript("$get('tdContenido').style.height='520px'")
- TxtNombre.Focus()
+ 'TxtNombre.Focus()
ViewState("Opt") = IfNull(Request("Opt"), "")
@@ -31,29 +31,26 @@ Partial Class PopUpBuscarProspectos
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
- Dim ObjProsp As New ClsProspectos()
+ Dim ObjCRM As New ClsCRM()
- Dim Nombre As String = "-1"
+ Dim RFC As String = "-1"
Dim NombreEmpresa As String = "-1"
- Dim Celular As String = "-1"
-
- If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
- If TxtNombreEmpresa.Text.Trim <> String.Empty Then NombreEmpresa = TxtNombreEmpresa.Text.Trim
- If txtCelular.Text.Trim <> String.Empty Then Celular = txtCelular.Text.Trim
-
- If ObjProsp.GetProspectosDetalle(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, Nombre, NombreEmpresa, Celular, UsuarioActual.CveEmpresa) Then
- If ObjProsp.DtResultados.Rows.Count > 0 Then
- LtlTotalRegistros.Text = ObjProsp.DtResultados.Rows.Count.ToString.FormatoNumero(0)
- GV.DataSource = ObjProsp.DtResultados
+ If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
+ If TxtNombreEmpresa.Text.Trim <> String.Empty Then NombreEmpresa = TxtNombreEmpresa.Text.Trim
+
+ If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, -1, NombreEmpresa, RFC) Then
+ If ObjCRM.DtResultados.Rows.Count > 0 Then
+ LtlTotalRegistros.Text = ObjCRM.DtResultados.Rows.Count.ToString.FormatoNumero(0)
+ GV.DataSource = ObjCRM.DtResultados
Else
LtlTotalRegistros.Text = "0"
GV.DataSource = Nothing
- Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
+ Alert("No se encontraron registros con los parámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
- ObjProsp.Dispose()
+ ObjCRM.Dispose()
GV.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
@@ -62,12 +59,17 @@ Partial Class PopUpBuscarProspectos
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(250)
- 'e.Row.Cells(1).Width = Unit.Pixel(80)
+ e.Row.Cells(0).Width = Unit.Pixel(250)
+ e.Row.Cells(1).Width = Unit.Pixel(80)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
- e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospeccion/Prospectos.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
+ e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
+ e.Row.FCHyperLink("Hp2").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
+ e.Row.FCHyperLink("Hp3").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
+ e.Row.FCHyperLink("Hp4").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
+ e.Row.FCHyperLink("Hp5").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
+ e.Row.FCHyperLink("Hp6").Attributes.Add("onclick", String.Format("Ir('/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}')", e.Row.DBCampo("CveEmpresaCRM")))
End If
End Sub
End Class
| |