//计算,指定增长率,再按指定的增长率计算 private void barButtonItem9_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!CanEdit) { MsgBox.Show("您没有权限进行此项操作!"); return; } FormIncreasingRate frm = new FormIncreasingRate(); frm.IncreasingRate = _increasingRate; if (frm.ShowDialog() != DialogResult.OK) { return; } _increasingRate = frm.IncreasingRate; treeList1.BeginUpdate(); try { double increase = Math.Pow((1 + _increasingRate), forecastReport.EndYear - forecastReport.StartYear); for (int i = 1; i < 13; i++) { dataTable.Rows[1][i.ToString() + "月"] = Math.Round((double)dataTable.Rows[0][i.ToString() + "月"] * increase, 2); } CalculateSum(treeList1.Nodes[1]); RefreshChart(); } catch (Exception ex) { chart1.Series.Clear(); MsgBox.Show("计算出错:出现异常数据!" + ex.Message); } finally { treeList1.EndUpdate(); } }
//���㣬ָ�������ʣ��ٰ�ָ���������ʼ��� private void barButtonItem9_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!CanEdit) { MsgBox.Show("��û��Ȩ���д��������"); return; } FormIncreasingRate frm = new FormIncreasingRate(); frm.IncreasingRate = _increasingRate; if (frm.ShowDialog() != DialogResult.OK) { return; } _increasingRate = frm.IncreasingRate; treeList1.BeginUpdate(); try { double increase = Math.Pow((1 + _increasingRate), forecastReport.EndYear - forecastReport.StartYear); for (int i = 1; i < 13; i++) { dataTable.Rows[1][i.ToString() + "��"] = Math.Round((double)dataTable.Rows[0][i.ToString() + "��"] * increase, 2); } CalculateSum(treeList1.Nodes[1]); RefreshChart(); } catch(Exception ex) { chart1.Series.Clear(); MsgBox.Show("�������������쳣���ݣ�" + ex.Message); } finally { treeList1.EndUpdate(); } }