Пример #1
0
        protected Chart GetChart()
        {
            if (_chart_mng == null)
            {
                _chart_mng = new ChartMng(MainBaseForm.Instance, typeof(Skin05.ChartSkinForm));
            }

            return(_chart_mng.NewChart());
        }
Пример #2
0
        private string reporte(HttpContext context)
        {
            string  response = string.Empty;
            string  option   = context.Request["opt"].ToString();
            ChartJs oChart;

            switch (option)
            {
            case "Unidades":
                jsonData = new StreamReader(context.Request.InputStream).ReadToEnd();
                oChart   = JsonConvert.DeserializeObject <ChartJs>(jsonData);
                response = JsonConvert.SerializeObject(ChartMng.getUnidades(oChart.Opcion, oChart.Anio, oChart.Mes, oChart.Id_cliente, oChart.Id_bodega));
                break;
            }

            return(response);
        }
Пример #3
0
        protected void btnGetChart_click(object sender, EventArgs args)
        {
            try
            {
                ChartMng oCMng = new ChartMng();
                string   path  = HttpContext.Current.Server.MapPath("~/rpt/chart/") + "RegistroEntradasSalidas.xls";

                int numero = 0;
                int.TryParse(ddlCliente.SelectedValue, out numero);
                int IdCliente = numero;
                numero = 0;

                int.TryParse(ddlBodega.SelectedValue, out numero);
                int IdBodega = numero;
                numero = 0;

                DateTime fecha = new DateTime(1, 1, 1);

                DateTime periodo_ini = new DateTime();
                DateTime.TryParse(txt_fecha_ini.Text, out fecha);
                periodo_ini = fecha;
                fecha       = new DateTime(1, 1, 1);

                DateTime periodo_fin = new DateTime();
                DateTime.TryParse(txt_fecha_fin.Text, out fecha);
                periodo_fin = fecha;
                fecha       = new DateTime(1, 1, 1);

                oCMng.createChart(IdBodega, IdCliente, periodo_ini.Year, periodo_ini.DayOfYear, periodo_fin.Year, periodo_fin.DayOfYear, path);
                lnkChart.NavigateUrl = "~/rpt/chart/RegistroEntradasSalidas.xls";
                lnkChart.Text        = "Descargar Registro de Entradas y Salidas";
                lnkChart.Visible     = true;
            }
            catch (Exception e)
            {
                ((MstCasc)this.Master).setError = e.Message;
            }
        }