108 lines
4.0 KiB
C#
108 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using Extensiones;
|
|
using System.Data;
|
|
using Microsoft.Reporting.WebForms;
|
|
|
|
using ADSNetLibrary.SIGAPI.Services.CRM;
|
|
using ADSNetLibrary.SIGAPI.Models.CRM.Request;
|
|
|
|
//using ADSNetLibrary.SIGAPI.Helpers;
|
|
|
|
public partial class CRM_AgendasBitacoras : ClsPaginas
|
|
{
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
InicializaDatos();
|
|
CargaDatos();
|
|
|
|
}
|
|
}
|
|
|
|
#region "CARGA DATOS"
|
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
|
{
|
|
CargaDatos();
|
|
}
|
|
|
|
protected void CargaDatos()
|
|
{
|
|
ClsCRM ObjCRM = new ClsCRM();
|
|
//nt CveEmpresa, int CveVendedor, int CveTipoProceso, DateTime FechaInicio, DateTime FechaFin
|
|
|
|
if (ObjCRM.RepAgendasBitacoras(UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(),DdlTipoProceso.SelectedValue.ToEntero(), TxtFechaInicio.Text.ToDate(), TxtFechaFin.Text.ToDate()))
|
|
{
|
|
GVDatos.DataSource = ObjCRM.DtResultados;
|
|
GVDatos.DataBind();
|
|
}
|
|
|
|
ObjCRM.Dispose();
|
|
UPDatos.Update();
|
|
|
|
}
|
|
|
|
protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
|
{
|
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
|
{
|
|
//if (e.Row.DataKey("CveAcercamiento").ToEntero() > 0)
|
|
// e.Row.FCHyperLink("HplNombreAcercamiento").NavigateUrl = String.Format("/CRM/Acercamiento.aspx?CveAcercamiento={0}", e.Row.DataKey("CveAcercamiento"));
|
|
}
|
|
}
|
|
|
|
protected void InicializaDatos()
|
|
{
|
|
|
|
|
|
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
|
DdlVendedor.Items.Insert(0, new ListItem("Todos ", "-1"));
|
|
DdlVendedor.DataBind();
|
|
|
|
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
|
|
|
|
//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();
|
|
//DdlPS.setEsWebService(true);
|
|
//DdlPS.SelectedValue = "-1";
|
|
//DdlPS.SelectedText = "Todos";
|
|
//DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa);
|
|
//DdlGiroClasificacion.DataSource = dtGiroClasificaciones;
|
|
//DdlGiroClasificacion.DataBind();
|
|
//DdlGiroClasificacion.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
|
|
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
|
RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, -1);
|
|
RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa);
|
|
RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa, 1, -1);
|
|
|
|
//DdlEtapaProceso .DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetEtapaProcesoCRM(EtapaProceso).Result);
|
|
//DdlMedioCaptacion.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable( cRMService.GetMedioCaptacionCRM(MedioCaptacion).Result);
|
|
DdlTipoProceso.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetTipoProcesoCRM(tipoProceso).Result);
|
|
|
|
//DdlEtapaProceso.DataBind();
|
|
//DdlMedioCaptacion.DataBind();
|
|
DdlTipoProceso.DataBind();
|
|
|
|
//DdlEtapaProceso.Items.Insert(0,new ListItem("Todas", "-1"));
|
|
//DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
DdlTipoProceso.Items.Insert(0, new ListItem("Todos", "-1"));
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
protected void LnkExcel_Click(object sender, EventArgs e)
|
|
{
|
|
GVDatos.ExportToExcelX("RepAgendaBiracora");
|
|
}
|
|
} |