예제 #1
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List <int>   li = new List <int>();
            Ps_YearRange py = new Ps_YearRange();

            py.Col4 = "电力发展实绩";
            py.Col5 = Itop.Client.MIS.ProgUID;
            int firstyear, endyear;
            IList <Ps_YearRange> list = Itop.Client.Common.Services.BaseService.GetList <Ps_YearRange>("SelectPs_YearRangeByCol5andCol4", py);

            if (list.Count > 0)
            {
                firstyear = list[0].StartYear;
                endyear   = list[0].FinishYear;
            }
            else
            {
                firstyear     = 1990;
                endyear       = 2020;
                py.BeginYear  = 1990;
                py.FinishYear = endyear;
                py.StartYear  = firstyear;
                py.EndYear    = 2060;
                py.ID         = Guid.NewGuid().ToString();
                Itop.Client.Common.Services.BaseService.Create <Ps_YearRange>(py);
            }
            for (int i = firstyear; i <= endyear; i++)
            {
                li.Add(i);
            }

            FormChooseYears1 cy = new FormChooseYears1();

            cy.ListYearsForChoose = li;
            if (cy.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            foreach (DataRow a in cy.DT.Rows)
            {
                if (a["B"].ToString() == "True")
                {
                    ht.Add(Guid.NewGuid().ToString(), Convert.ToInt32(a["A"].ToString().Replace("年", "")));
                }

                if (a["C"].ToString() == "True")
                {
                    ht1.Add(Guid.NewGuid().ToString(), Convert.ToInt32(a["A"].ToString().Replace("年", "")));
                }
            }
            shjjbyyear = true;
            //电力发展实绩社会经济用电情况
            //  build_dlhistoryjjyd();
            //再回到原始状态
            shjjbyyear = false;
        }
예제 #2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List<int> li = new List<int>();
            Ps_YearRange py = new Ps_YearRange();
            py.Col4 = "电力发展实绩";
            py.Col5 = Itop.Client.MIS.ProgUID;
            int firstyear, endyear;
            IList<Ps_YearRange> list = Itop.Client.Common.Services.BaseService.GetList<Ps_YearRange>("SelectPs_YearRangeByCol5andCol4", py);
            if (list.Count > 0)
            {
                firstyear = list[0].StartYear;
                endyear = list[0].FinishYear;
            }
            else
            {
                firstyear = 1990;
                endyear = 2020;
                py.BeginYear = 1990;
                py.FinishYear = endyear;
                py.StartYear = firstyear;
                py.EndYear = 2060;
                py.ID = Guid.NewGuid().ToString();
                Itop.Client.Common.Services.BaseService.Create<Ps_YearRange>(py);
            }
            for (int i = firstyear; i <= endyear; i++)
            {
                li.Add(i);
            }

            FormChooseYears1 cy = new FormChooseYears1();
            cy.ListYearsForChoose = li;
            if (cy.ShowDialog() != DialogResult.OK)
                return;

            foreach (DataRow a in cy.DT.Rows)
            {
                if (a["B"].ToString() == "True")
                    ht.Add(Guid.NewGuid().ToString(), Convert.ToInt32(a["A"].ToString().Replace("年", "")));

                if (a["C"].ToString() == "True")
                    ht1.Add(Guid.NewGuid().ToString(), Convert.ToInt32(a["A"].ToString().Replace("年", "")));
            }
            shjjbyyear = true;
            //电力发展实绩社会经济用电情况
              //  build_dlhistoryjjyd();
            //再回到原始状态
            shjjbyyear = false;
        }