protected void btnguardar_Click(object sender, EventArgs e) { Limpiar(); ViewState["vwFacturasPorCobrar"] = _facturasContadoCredito.GetData(Convert.ToInt32(Request.Cookies["UserInfo"]["empresaId"].ToString()), dateFechaInicial.Date, dateFechaFinal.Date); BootstrapPieChart1.DataSource = ViewState["vwFacturasPorCobrar"]; BootstrapPieChart1.DataBind(); }
protected void BootstrapCalendar1_SelectionChanged(object sender, EventArgs e) { string FiltroFechaGrafico = ""; if (BootstrapCalendar1.SelectedDates.Count == 1) { FiltroFechaGrafico = "'" + BootstrapCalendar1.SelectedDate.ToString("dd/MM/yyyy") + "'"; } else if (BootstrapCalendar1.SelectedDates.Count > 1) { string FiltoFechas = ""; var Fechas = BootstrapCalendar1.SelectedDates.ToList(); for (int i = 0; i < Fechas.Count(); i++) { if (FiltoFechas == "") { FiltoFechas = "'" + Fechas[i].ToString("dd/MM/yyyy") + "'"; } else { FiltoFechas = FiltoFechas + ",'" + Fechas[i].ToString("dd/MM/yyyy") + "'"; } } FiltroFechaGrafico = FiltoFechas; } Session["FiltroFechaGrafico"] = FiltroFechaGrafico; if (FiltroFechaGrafico != "") { SqlDataSource_Grafico.SelectCommand = "select NombreProyecto + ' ' +Fecha as NombreProyecto,sum(Pagado) as Pagado from View_GraficoPagos where Fecha in(" + FiltroFechaGrafico + ") group by NombreProyecto + ' ' +Fecha"; } // DataSet dataSet = new DataSet(); //FG.MakeRecordSet(dataSet, "select NombreProyecto, sum(Pagado) as Pagado, Fecha from View_GraficoPagos where Fecha in (" + FiltroFechaGrafico + ") group by NombreProyecto, Fecha", ""); //SqlDataSource_Grafico.DataBind(); //BootstrapPieChart1.DataSourceID = ""; //BootstrapPieChart1.DataSource = dataSet; BootstrapPieChart1.DataBind(); //SqlDataSource_Grafico.FilterExpression = " Convert(varchar,FechaRecibo,103) IN (" + FiltroFechaGrafico + ")"; //SqlDataSource_Grafico.DataBind(); }
public void Limpiar() { ViewState["vwFacturasPorCobrar"] = ""; BootstrapPieChart1.DataSource = ViewState["vwFacturasPorCobrar"]; BootstrapPieChart1.DataBind(); }