Example #1
0
        //private void Del_Tz(DataRow dt)
        //{
        //    if (checkBox1.Checked)
        //    {
        //        for (int i = 0; i < gridView2.RowCount; i++)
        //        {
        //            if (dt["y" + gridView2.GetRowCellDisplayText(i,"S1")] != null)
        //            {
        //                double tempdoub = Convert.ToDouble(gridView2.GetRowCellDisplayText(i, "S2"));
        //                tempdoub+=Convert.ToDouble(dt["y"+gridView2.GetRowCellDisplayText(i,"S1")].ToString());
        //                gridView2.SetRowCellValue(i, "S2",tempdoub);
        //            }
        //        }
        //    }
        //    else
        //    {
        //        for (int i = 0; i < gridView2.RowCount; i++)
        //        {
        //            //if (dt["y" + gridView2.GetRowCellDisplayText(i, "S1")] != null)
        //            {
        //                double tempdoub = Convert.ToDouble(dt["y" + gridView2.GetRowCellDisplayText(i, "S1")].ToString());
        //                gridView2.SetRowCellValue(i, "S2", tempdoub);
        //            }
        //        }
        //    }
        //}

        private void simpleButton4_Click(object sender, EventArgs e)
        {
            FormForecastData ffs = new FormForecastData();

            //  ffs.Type = type;

            ffs.StartYear = s1;
            ffs.EndYear   = s1 + s4;
            if (ffs.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Hashtable hs = ffs.HS;

            lis.Clear();

            if (hs.Count == 0)
            {
                return;
            }
            foreach (Ps_Forecast_Math de3 in hs.Values)
            {
                int zhuanhuan = 1;
                if (de3.Title.IndexOf("亿") != -1)
                {
                    zhuanhuan = 10000;
                }
                for (int i = 0; i < s4; i++)
                {
                    EconomyData ed = new EconomyData();
                    ed.S1 = s1 + i;
                    double tempdoub = Convert.ToDouble(de3.GetType().GetProperty("y" + (s1 + i)).GetValue(de3, null).ToString());
                    tempdoub = tempdoub * zhuanhuan;
                    ed.S2    = Math.Round(tempdoub, 2);
                    lis.Add(ed);
                }
                gridControl1.DataSource = lis;
                gridControl1.RefreshDataSource();
            }
        }
Example #2
0
        //private void Del_Tz(DataRow dt)
        //{
        //    if (checkBox1.Checked)
        //    {
        //        for (int i = 0; i < gridView2.RowCount; i++)
        //        {
        //            if (dt["y" + gridView2.GetRowCellDisplayText(i,"S1")] != null)
        //            {
        //                double tempdoub = Convert.ToDouble(gridView2.GetRowCellDisplayText(i, "S2"));
        //                tempdoub+=Convert.ToDouble(dt["y"+gridView2.GetRowCellDisplayText(i,"S1")].ToString());
        //                gridView2.SetRowCellValue(i, "S2",tempdoub);
        //            }
        //        }
        //    }
        //    else
        //    {
        //        for (int i = 0; i < gridView2.RowCount; i++)
        //        {
        //            //if (dt["y" + gridView2.GetRowCellDisplayText(i, "S1")] != null)
        //            {
        //                double tempdoub = Convert.ToDouble(dt["y" + gridView2.GetRowCellDisplayText(i, "S1")].ToString());
        //                gridView2.SetRowCellValue(i, "S2", tempdoub);
        //            }
        //        }
        //    }
        //}
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            FormForecastData ffs = new FormForecastData();
            //  ffs.Type = type;

            ffs.StartYear = s1;
            ffs.EndYear = s1+s4;
            if (ffs.ShowDialog() != DialogResult.OK)
                return;
            Hashtable hs = ffs.HS;

            lis.Clear();

            if (hs.Count == 0)
                return;
            foreach (Ps_Forecast_Math de3 in hs.Values)
                {
                    int zhuanhuan = 1;
                    if (de3.Title.IndexOf("��")!=-1)
                    {
                        zhuanhuan = 10000;
                    }
                   for (int i = 0; i < s4; i++)
                        {
                            EconomyData ed = new EconomyData();
                            ed.S1 = s1 + i;
                            double tempdoub = Convert.ToDouble(de3.GetType().GetProperty("y" + (s1 + i)).GetValue(de3, null).ToString());
                            tempdoub = tempdoub * zhuanhuan;
                       ed.S2 = Math.Round(tempdoub, 2);
                            lis.Add(ed);

                         }
                        gridControl1.DataSource = lis;
                        gridControl1.RefreshDataSource();
             }
        }