carga de trabajo sobre la retroalimentación
This commit is contained in:
@@ -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("<strong>Vendedor:</strong> {0} ", (DdlVendedor.SelectedValue != "-1" ? DdlVendedor.SelectedItem.Text : "Todos"));
|
||||
string ProductoServicioFiltro = String.Format("<strong>Producto Servicio:</strong> {0} ", (DdlPS.SelectedValue != "-1" ? DdlPS.SelectedText : "Todos"));
|
||||
string GiroFiltro = String.Format("<strong>Giro:</strong> {0} ", (DdlGiroClasificacion.SelectedValue != "-1" ? DdlGiroClasificacion.SelectedItem.Text : "Todos"));
|
||||
string FechaInicioFiltro = String.Format("<strong>Fecha Inicio:</strong> {0} ", TxtFechaInicio.Text);
|
||||
string FechaFinFiltro = String.Format("<strong>Fecha Fin:</strong> {0} ", TxtFechaFin.Text);
|
||||
|
||||
string Filtros = String.Format("{0}{1}{2}{3}{4}", VendedorFiltro, FechaInicioFiltro, FechaFinFiltro, ProductoServicioFiltro, GiroFiltro);
|
||||
|
||||
List<ReportParameter> @params = new List<ReportParameter>();
|
||||
@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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user