private void AddNodeDataToList(TreeListNode node, IList <PSP_ForecastValues> list)
        {
            foreach (TreeListColumn col in treeList2.Columns)
            {
                if (col.FieldName.IndexOf("年") > 0)
                {
                    object obj = node.GetValue(col.FieldName);
                    if (obj != DBNull.Value)
                    {
                        PSP_ForecastValues v = new PSP_ForecastValues();
                        v.ForecastID = forecastReport.ID;
                        v.TypeID     = (int)node.GetValue("ID");
                        v.Caption    = node.GetValue("Title").ToString() + "," + v.TypeID;
                        v.Year       = Convert.ToInt32(col.FieldName.Replace("年", ""));
                        v.Value      = (double)node.GetValue(col.FieldName);

                        list.Add(v);
                    }
                }
            }

            foreach (TreeListNode nd in node.Nodes)
            {
                AddNodeDataToList(nd, list);
            }
        }
Пример #2
0
        //读取数据
        private void LoadValues()
        {
            if (!formselect)
            {
                PSP_ForecastValues psp_Value = new PSP_ForecastValues();
                psp_Value.ForecastID = forecastReport.ID;

                IList <PSP_ForecastValues> listValues = Common.Services.BaseService.GetList <PSP_ForecastValues>("SelectPSP_ForecastValuesByForecastID", psp_Value);
                foreach (PSP_ForecastValues value in listValues)
                {
                    TreeListNode node = treeList2.FindNodeByFieldValue("ID", value.TypeID);
                    if (node != null && value.Year >= forecastReport.StartYear && value.Year <= forecastReport.EndYear)
                    {
                        node.SetValue(value.Year + "年", value.Value);
                    }
                }
            }
            else
            {
                string str = "Flag2=" + forecastReport.ID;
                IList <PSP_P_Values> listValues = Common.Services.BaseService.GetList <PSP_P_Values>("SelectPSP_P_ValuesByWhere", str);
                foreach (PSP_P_Values value in listValues)
                {
                    TreeListNode node = treeList2.FindNodeByFieldValue("ID", value.TypeID);
                    if (node != null && value.Year >= forecastReport.StartYear && value.Year <= forecastReport.EndYear)
                    {
                        node.SetValue(value.Year + "年", value.Value);
                    }
                }
            }
        }
Пример #3
0
        //把节点数据存放到对象中,插入进List
        private void AddNodeDataToList(TreeListNode node, IList <PSP_ForecastValues> list, bool allCol)
        {
            for (int i = 1; i < (allCol ? 16 : 13); i++)
            {
                object obj   = node.GetValue(i.ToString() + "月");
                double value = 0.0;
                if (obj != DBNull.Value)
                {
                    value = (double)obj;
                }
                PSP_ForecastValues v = new PSP_ForecastValues();
                v.ForecastID = forecastReport.ID;
                v.TypeID     = (int)node.GetValue("TypeID");
                v.Caption    = node.GetValue("Title").ToString();
                v.Year       = i;
                v.Value      = value;

                list.Add(v);
            }

            foreach (TreeListNode nd in node.Nodes)
            {
                AddNodeDataToList(nd, list, allCol);
            }
        }
Пример #4
0
        //读取数据
        private void LoadValues()
        {
            //PSP_P_Values PSP_P_Values = new PSP_P_Values();
            //PSP_P_Values.ID = typeFlag2;//用ID字段存放Flag2的值

            //IList<PSP_P_Values> listValues = Common.Services.BaseService.GetList<PSP_P_Values>("SelectPSP_P_ValuesListByFlag2", PSP_P_Values);


            string str = " TypeID in(80001,80002,80003,80004,80005,80006) and Flag2=" + typeFlag2;
            IList <PSP_P_Values> listValues = Common.Services.BaseService.GetList <PSP_P_Values>("SelectPSP_P_ValuesByWhere", str);



            foreach (PSP_P_Values value in listValues)
            {
                TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
                if (node != null)
                {
                    node.SetValue(value.Year + "年", value.Value);
                }
            }



            PSP_ForecastValues psp_Value = new PSP_ForecastValues();

            psp_Value.ForecastID = typeFlag2;

            IList <PSP_ForecastValues> listValues1 = Common.Services.BaseService.GetList <PSP_ForecastValues>("SelectPSP_ForecastValuesByForecastID", psp_Value);

            foreach (PSP_ForecastValues value in listValues1)
            {
                try
                {
                    TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
                    if (node != null && value.Year >= forecastReport.StartYear && value.Year <= forecastReport.EndYear)
                    {
                        node.SetValue(value.Year + "年", value.Value);
                    }
                }
                catch { }
            }
        }
Пример #5
0
        //读取数据
        private void LoadValues()
        {
            PSP_ForecastReports pf        = Services.BaseService.GetOneByKey <PSP_ForecastReports>(typeFlag2);
            PSP_ForecastValues  psp_Value = new PSP_ForecastValues();

            psp_Value.ForecastID = typeFlag2;

            IList <PSP_ForecastValues> listValues = Common.Services.BaseService.GetList <PSP_ForecastValues>("SelectPSP_ForecastValuesByForecastID", psp_Value);

            foreach (PSP_ForecastValues value in listValues)
            {
                TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
                if (node != null && value.Year >= pf.StartYear && value.Year <= pf.EndYear)
                {
                    node.SetValue(value.Year + "年", value.Value);
                }
            }



            ////////PSP_ForecastReports pf = Services.BaseService.GetOneByKey<PSP_ForecastReports>(typeFlag2);


            ////////string str = " TypeID not in(80001,80002,80003,80004,80005,80006) and Flag2=" + typeFlag2;
            ////////IList<PSP_P_Values> listValues = Common.Services.BaseService.GetList<PSP_P_Values>("SelectPSP_P_ValuesByWhere", str);

            ////////foreach (PSP_P_Values value in listValues)
            ////////{
            ////////    TreeListNode node = treeList1.FindNodeByFieldValue("ID", value.TypeID);
            ////////    if (node != null)
            ////////    {
            ////////        if (value.Year <= pf.EndYear)
            ////////        {
            ////////            value.Value = Math.Round(value.Value);
            ////////            node.SetValue(value.Year + "年", value.Value);
            ////////        }
            ////////    }
            ////////}
        }
Пример #6
0
        //读取数据
        private void LoadValues()
        {
            PSP_ForecastValues psp_Value = new PSP_ForecastValues();

            psp_Value.ForecastID = forecastReport.ID;

            IList <PSP_ForecastValues> listValues = Common.Services.BaseService.GetList <PSP_ForecastValues>("SelectPSP_ForecastValuesByForecastID", psp_Value);

            if (listValues.Count == 0)
            {
                BurdenMonth bm1 = new BurdenMonth();
                bm1.BurdenYear = forecastReport.StartYear;

                BurdenMonth bm = (BurdenMonth)Common.Services.BaseService.GetObject("SelectBurdenMonthByBurdenYear", bm1);
                if (bm != null)
                {
                    //TreeListNode node = treeList1.FindNodeByFieldValue("TypeID", value.TypeID);
                    //if (node != null)
                    //{
                    //    node.SetValue(value.Year + "月", value.Value);
                    //}
                    treeList1.MoveFirst();
                    TreeListNode node = treeList1.FocusedNode;
                    node.SetValue("1月", bm.Month1);
                    node.SetValue("2月", bm.Month2);
                    node.SetValue("3月", bm.Month3);
                    node.SetValue("4月", bm.Month4);
                    node.SetValue("5月", bm.Month5);
                    node.SetValue("6月", bm.Month6);
                    node.SetValue("7月", bm.Month7);
                    node.SetValue("8月", bm.Month8);
                    node.SetValue("9月", bm.Month9);
                    node.SetValue("10月", bm.Month10);
                    node.SetValue("11月", bm.Month11);
                    node.SetValue("12月", bm.Month12);


                    double bmsum = bm.Month1 + bm.Month2 + bm.Month3 + bm.Month4 + bm.Month5 + bm.Month6;
                    bmsum += bm.Month7 + bm.Month8 + bm.Month9 + bm.Month10 + bm.Month11 + bm.Month12;

                    double bmmax = Math.Max(bm.Month1, bm.Month2);
                    bmmax = Math.Max(bmmax, bm.Month3);
                    bmmax = Math.Max(bmmax, bm.Month4);
                    bmmax = Math.Max(bmmax, bm.Month5);
                    bmmax = Math.Max(bmmax, bm.Month6);
                    bmmax = Math.Max(bmmax, bm.Month7);
                    bmmax = Math.Max(bmmax, bm.Month8);
                    bmmax = Math.Max(bmmax, bm.Month9);
                    bmmax = Math.Max(bmmax, bm.Month10);
                    bmmax = Math.Max(bmmax, bm.Month11);
                    bmmax = Math.Max(bmmax, bm.Month12);



                    node.SetValue("13月", bmsum);
                    node.SetValue("14月", bmmax);
                    node.SetValue("15月", bmsum / (bmmax * 12));
                }
            }

            else
            {
                foreach (PSP_ForecastValues value in listValues)
                {
                    TreeListNode node = treeList1.FindNodeByFieldValue("TypeID", value.TypeID);
                    if (node != null)
                    {
                        node.SetValue(value.Year + "月", value.Value);
                    }
                }
            }
        }