Пример #1
0
        private void cargarGraficas()
        {
            /*Grafica del cliente*/


            /*Grafica TRM*/
            AreaChart.DataSource = negocio.GetDataTable("select valorTRM, convert(varchar,fechaTRM,103) fecha from Trm order by fechaTRM asc");
            AreaChart.DataBind();
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     negocio = new Implementacion();
     //Random rnd = new Random();
     //DateTime inicio = DateTime.Now.AddDays(-11);
     //int idCliente = 1;
     //for (int i = 0; i < 30; i++)
     //{
     //    if(i==10 || i==20)
     //        inicio = DateTime.Now.AddDays(-11);
     //    inicio = inicio.AddDays(1);
     //    String MyString_new = inicio.Year + "-" + inicio.Month + "-" + inicio.Day;
     //    double estimado = rnd.Next(1, 20000000);
     //    int limite1 = Convert.ToInt32(estimado - (estimado * 0.25));
     //    int limite2 = Convert.ToInt32(estimado + (estimado * 0.25));
     //    double presupuestado = rnd.Next(limite1, limite2);
     //    limite1 = Convert.ToInt32(estimado - (estimado * 0.30));
     //    limite2 = Convert.ToInt32(estimado + (estimado * 0.50));
     //    double ejecutado = rnd.Next(limite1, limite2);
     //    double duracionContrato = rnd.Next(1, 25);
     //    double trm = rnd.Next(2500, 3400);
     //    double valorcompetencia = rnd.Next(limite1, limite2);
     //    if (i == 10)
     //        idCliente = 2;
     //    if (i == 20)
     //        idCliente = 3;
     //    string sql = "INSERT INTO [dbo].[AnalisisProyecto] \n" +
     //                       "([valorEstimado] \n" +
     //                       ",[idCliente] \n" +
     //                       ",[valorPresupuesto] \n" +
     //                       ",[valorRealEjecutado] \n" +
     //        //",[idTipoProyecto] \n" +
     //                       ",[duracionContrato] \n" +
     //                       ",[trm] \n" +
     //                       ",[valorCompetencia] \n" +
     //                       ",[creadoPor] \n" +
     //                       ",[creadoFecha]) \n" +
     //                 "VALUES \n" +
     //                       "(" + estimado + " \n" +
     //                       "," + idCliente + " \n" +
     //                       "," + presupuestado + " \n" +
     //                       "," + ejecutado + " \n" +
     //        //",<idTipoProyecto, int,> \n" +
     //                       "," + duracionContrato + " \n" +
     //                       "," + trm + " \n" +
     //                       "," + valorcompetencia + " \n" +
     //                       ",'sys' \n" +
     //                       ",'" + MyString_new + "')";
     //    negocio.ExecuteNonQuery(sql);
     //}
     if (!Page.IsPostBack)
     {
         cargarGraficas();
         DataTable dtTrm = negocio.GetDataTable("select top 1 valorTRM from [dbo].[Trm] order by fechaTRM desc");
         txtTRM.Text    = dtTrm.Rows[0]["valorTRM"].ToString();
         txtTRM.Enabled = false;
     }
 }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        negocio = new Implementacion();
        RadHtmlChart1.DataSource = negocio.GetDataTable("select top 10 totalRegistros, regErroneos, regCorrectos, convert(varchar,CreadoFecha,103) fecha from LogsJobs where tipoJob = 1 order by fecha desc");
        RadHtmlChart1.DataBind();

        AreaChart.DataSource = negocio.GetDataTable("select top 10 totalRegistros, regErroneos, regCorrectos, convert(varchar,CreadoFecha,103) fecha from LogsJobs where tipoJob = 2 order by fecha desc");
        AreaChart.DataBind();

        RadHtmlChart2.DataSource = negocio.GetDataTable("select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regErroneos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Acividades' as label from LogsJobs where tipoJob = 1 " +
                                                        "union all " +
                                                        "select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regCorrectos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Horas' as label from LogsJobs where tipoJob = 1");
        RadHtmlChart2.DataBind();

        RadHtmlChart3.DataSource = negocio.GetDataTable("select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regErroneos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Actividades' as label from LogsJobs where tipoJob = 2 " +
                                                        "union all " +
                                                        "select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regCorrectos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Horas' as label from LogsJobs where tipoJob = 2");
        RadHtmlChart3.DataBind();
    }