Exemplo n.º 1
0
 private List <RepExcesos> GetList()
 {
     try
     {
         List <RepExcesos> List   = new List <RepExcesos>();
         CN_Rep_InvExceso  exceso = new CN_Rep_InvExceso();
         RepExcesos        rep    = new RepExcesos();
         rep.Id_Emp    = sesion.Id_Emp;
         rep.Id_Cd     = sesion.Id_Cd_Ver;
         rep.Id_U      = sesion.Id_U;
         rep.Indicador = Convert.ToInt32(Page.Request.QueryString["Indicador"]);
         rep.Proveedor = Convert.ToInt32(Page.Request.QueryString["Proveedor"]);
         rep.Centro    = Convert.ToInt32(Page.Request.QueryString["Centro"]);
         rep.Dias      = Convert.ToInt32(Page.Request.QueryString["Dias"]);
         rep.DiasVer   = Convert.ToInt32(Page.Request.QueryString["DiasVer"]);
         rep.Tproducto = Convert.ToInt32(Page.Request.QueryString["Tproducto"]);
         rep.Salida    = 2;
         exceso.Consulta(rep, sesion.Emp_Cnx, ref List);
         return(List);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private List <RepExcesos> GetList()
        {
            try
            {
                List <RepExcesos> List   = new List <RepExcesos>();
                CN_Rep_InvExceso  exceso = new CN_Rep_InvExceso();
                RepExcesos        rep    = new RepExcesos();
                rep.Id_Emp       = sesion.Id_Emp;
                rep.Id_Cd        = sesion.Id_Cd_Ver;
                rep.Id_U         = sesion.Id_U;
                rep.Indicador    = Convert.ToInt32(Page.Request.QueryString["Indicador"]);
                rep.Proveedor    = Convert.ToInt32(Page.Request.QueryString["Proveedor"]);
                rep.Centro       = Convert.ToInt32(Page.Request.QueryString["Centro"]);
                rep.Dias         = Convert.ToInt32(Page.Request.QueryString["Dias"]);
                rep.Tproducto    = Convert.ToInt32(Page.Request.QueryString["Tproducto"]);
                rep.ProveedorVer = Convert.ToInt32(Page.Request.QueryString["ProveedorVer"]);
                rep.DiasVer      = Convert.ToInt32(Page.Request.QueryString["DiasVer"]);
                rep.Salida       = 3;
                exceso.Consulta3(rep, sesion.Emp_Cnx, ref List);

                indicadorTexto = "";

                if (rep.Indicador == -1)
                {
                    indicadorTexto = " TODOS";
                }
                else if (rep.Indicador == 1)
                {
                    indicadorTexto = " QUE ROTA";
                }
                else
                {
                    indicadorTexto = " QUE NO ROTA";
                }
                LblTitulo.Text = LblTitulo.Text.Replace("Rota", indicadorTexto == "TODOS" ? "TODOS" : indicadorTexto);

                return(List);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public string GeneraGraficaDistribucion()
        {
            ValidarSesion();
            string caption    = "Exceso de inventario";
            string subcaption = "Click en la columna para ver el detalle";
            string yAxsisName = "Costo de exceso de inventario";
            string xAxsisName = "";
            double Total      = 0;

            int dias      = Convert.ToInt32(Page.Request.QueryString["Dias"]);
            int proveedor = Convert.ToInt32(Page.Request.QueryString["Proveedor"]);
            int centro    = Convert.ToInt32(Page.Request.QueryString["Centro"]);
            int tproducto = Convert.ToInt32(Page.Request.QueryString["Tproducto"]);
            int indicador = Convert.ToInt32(Page.Request.QueryString["indicador"]);

            string indicadorTexto = "";

            if (indicador == -1)
            {
                indicadorTexto = " TODOS";
            }
            else if (indicador == 1)
            {
                indicadorTexto = " que ROTA";
            }
            else
            {
                indicadorTexto = " que NO ROTA";
            }


            DataTable valores = new DataTable();

            valores.Columns.Add("Dias");
            valores.Columns.Add("Costo");
            CN_Rep_InvExceso cn_exceso = new CN_Rep_InvExceso();
            RepExcesos       exceso    = new RepExcesos();
            Funciones        funcionf  = new Funciones();

            exceso.Id_Emp    = sesion.Id_Emp;
            exceso.Id_Cd     = sesion.Id_Cd_Ver;
            exceso.Centro    = centro;
            exceso.Proveedor = proveedor;
            exceso.Dias      = dias;
            //exceso.FechaReporte =  funcionf.GetLocalDateTime(sesion.Minutos);
            exceso.Tproducto = tproducto;
            exceso.Salida    = 1;
            exceso.Id_U      = sesion.Id_U;
            exceso.Indicador = indicador;
            cn_exceso.ConsultaGrafica(exceso, ref valores, sesion.Emp_Cnx);

            //valores.Add(0);
            //valores.Add(91457);
            //valores.Add(567638);
            //valores.Add(254054);
            //valores.Add(148640);
            //valores.Add(1164030);

            int columnas = 0;

            switch (dias)
            {
            case 30: columnas = 6;
                break;

            case 60: columnas = 3;
                break;

            case 90:
            case 120:
                columnas = 2;
                break;
            }
            double        value;
            StringBuilder xmlData = new StringBuilder();

            xmlData.Append("<chart subCaption='" + subcaption + "' Caption='" + caption + indicadorTexto + "' xAxisName='" + xAxsisName + "' yAxisName='" + yAxsisName + "' showValues='1' formatNumberScale='0' showBorder='0' numberPrefix='$' showSum='1' decimals='4'>");
            for (int i = 0; i < columnas; i++)
            {
                if (valores.Select("Dias='" + (dias * (i + 1)) + "'").Count() == 0)
                {
                    value = 0;
                }
                else
                {
                    value = Convert.ToDouble(valores.Select("Dias='" + (dias * (i + 1)) + "'")[0].ItemArray[1]);
                }
                xmlData.Append("<set label='Días: " + (dias * (i + 1)).ToString() + "' value='" + value + "' link='javascript:myJS(" + proveedor + "," + centro + "," + tproducto + ", " + (dias * (i + 1)).ToString() + "," + indicador + "," + dias + ")'/>");
                Total += value;
            }
            xmlData.Append("<set label='Total' value='" + Total + "' link='javascript:myJS(" + proveedor + "," + centro + "," + tproducto + ", -1 ," + indicador + "," + dias + ")'/>");
            xmlData.Append("<styles>");
            xmlData.Append("<definition>");
            xmlData.Append("<style name='myCaptionFont' type='font' font='Arial' size='14' bold='1'/>");
            xmlData.Append("</definition>");
            xmlData.Append("<application>");
            xmlData.Append("<apply toObject='Caption' styles='myCaptionFont'/>");
            xmlData.Append("</application>");
            xmlData.Append("</styles>");
            xmlData.Append("</chart>");
            return(InfoSoftGlobal.FusionCharts.RenderChartHTML("FusionCharts/Column3D.swf", "", xmlData.ToString(), "myNext", "100%", "300", false));
        }