Esempio n. 1
0
        public static string getSelectItem <T>(T obj, int index)
        {
            string        tmp    = "";
            getProperties pro    = new getProperties();
            List <string> tmpStr = pro.getproperty(obj);

            tmp = tmpStr[index];
            return(tmp);
        }
Esempio n. 2
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void okBtn_clickHandler(object sender, RoutedEventArgs e)
        {
            this.mychart.Series.Clear();
            _dynamicData = new DataPointCollection();
            string Xa = "MarketName";
            string Ya = "";// this.yaxis.SelectedItem.ToString();

            property = new getProperties();
            DataSeries dataS = new DataSeries();

            if (IsFinancial)
            {
                Ya = dataBing.getSelectItem(financialsInfo[0], this.yaxis.SelectedIndex + 2);
                for (int i = 0; i < financialsInfo.Count; i++)
                {
                    dataS.DataPoints.Add(property.getDynamic(financialsInfo[i], Xa, Ya));
                }
            }
            else
            {
                Ya = dataBing.getSelectItem(prodectsInfo[0], this.yaxis.SelectedIndex);
                for (int i = 0; i < prodectsInfo.Count; i++)
                {
                    if (prodectsInfo[i].ProdectName == this.Name)
                    {
                        dataS.DataPoints.Add(property.getDynamic(prodectsInfo[i], Xa, Ya));
                    }
                }
            }
            switch (_ChartType)
            {
            case "Columnar":
            {
                dataS.RenderAs = RenderAs.Column;
                break;
            }

            case "Pie":
            {
                dataS.RenderAs = RenderAs.Pie;
                break;
            }
            }

            this.mychart.Series.Add(dataS);
        }
        /// <summary>
        /// 统计
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void static_Click(object sender, RoutedEventArgs e)
        {
            bool f = (bool)this.financialRb.IsChecked;
            bool p = (bool)this.prodectRb.IsChecked;

            if (f || p)
            {
                List <string> Attributes = null;
                if (chart == null)
                {
                    chart = new prodectChart();
                }
                if (properties == null)
                {
                    properties = new getProperties();
                }
                if (IsFinancial)
                {
                    if (_fincials != null && _fincials.Count > 0)
                    {
                        Attributes           = new List <string>();
                        Attributes           = dataBing.financialYStr1();
                        chart.IsFinancial    = true;
                        chart.Name           = "财务信息";
                        chart.financialsInfo = _fincials;
                    }
                    else
                    {
                        MessageBox.Show("财务没有统计信息");
                        return;
                    }
                }
                else
                {
                    if (_prodects != null && _prodects.Count > 0)
                    {
                        if (this.proName == "")
                        {
                            MessageBox.Show("请选择要统计的货物名称");
                            return;
                        }
                        Attributes         = new List <string>();
                        Attributes         = dataBing.prodectsStr1();
                        chart.IsFinancial  = false;
                        chart.Name         = this.proName;
                        chart.prodectsInfo = _prodects;
                    }
                    else
                    {
                        MessageBox.Show("货物没有统计信息");
                        return;
                    }
                }
                chart.setDataProvider(Attributes);
                chart.Show();
            }
            else
            {
                MessageBox.Show("未选则要统计的类型(财务、货物统计)");
            }
        }