Пример #1
0
        //�����������
        private void simpleButton5_Click(object sender, EventArgs e)
        {
            FormLoadForecastDataDSH frm = new FormLoadForecastDataDSH(2);
            frm.ProjectUID = MIS.ProgUID;
            if (frm.ShowDialog() != DialogResult.OK)
                return;
            DataRow row = frm.ROW;
            lis.Clear();
            int zhuanhuan = 1;
            if (row["Title"].ToString().IndexOf("��") != -1)
            {
                zhuanhuan = 10000;
            }
            for (int i = 0; i < s4; i++)
            {
                EconomyData ed = new EconomyData();
                ed.S1 = s1 + i;
                double tempdoub = Convert.ToDouble(row["y" + (s1 + i)].ToString());
                tempdoub = tempdoub * zhuanhuan;
                ed.S2 = Math.Round(tempdoub, 2);
                lis.Add(ed);

            }
            gridControl1.DataSource = lis;
            gridControl1.RefreshDataSource();
        }
Пример #2
0
 private void barButtonItem15_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (this.treeList1.FocusedNode != null)
     {
         string nTitle = this.treeList1.FocusedNode.GetValue("Title").ToString();
         string nId = this.treeList1.FocusedNode.GetValue("Col1").ToString();
         if (nTitle == "需电量" && nId == "1")
         {
             Ps_Table_ElecPH psr = Common.Services.BaseService.GetOneByKey<Ps_Table_ElecPH>(this.treeList1.FocusedNode.GetValue("ID").ToString());
             Ps_Table_ElecPH old = (Ps_Table_ElecPH)psr.Clone();
             FormLoadForecastDataDSH frm = new FormLoadForecastDataDSH(2);
             frm.ProjectUID = GetProjectID;
             if (frm.ShowDialog() == DialogResult.OK)
             {
                // FrmFKbi fkb = new FrmFKbi();
               //  if (fkb.ShowDialog() == DialogResult.OK)
                 {
                     DataRow row = frm.ROW;
                     for (int i = yAnge.BeginYear; i <= yAnge.EndYear; i++)
                     {
                         psr.GetType().GetProperty("y" + i.ToString()).SetValue(psr, Math.Round(double.Parse(row["y" + i.ToString()].ToString()), 1), null);
                        // psr.GetType().GetProperty("y" + i.ToString()).SetValue(psr, Math.Round(double.Parse(row["y" + i.ToString()].ToString()) * fkb.GetVal, 1), null);
                     }
                     Common.Services.BaseService.Update<Ps_Table_500Result>(psr);
                     UpdateFuHe(psr.ParentID, "no", old, psr);
                   //  UpdateFuHe(psr.ParentID, "no1", old, psr);
                     LoadData1();
                 }
             }
         }
         else
         {
             MessageBox.Show("不是正确的需电量数据行,请选择正确的行!");
         }
     }
     else
     {
         MessageBox.Show("请选择要导入的需电量数据行!");
     }
 }