Esempio n. 1
0
        private void EditReport()
        {
            if (gridView1.FocusedRowHandle < 0)
            {
                return;
            }

            if (!base.EditRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }

            Ps_forecast_list   report = Itop.Common.DataConverter.RowToObject <Ps_forecast_list>(gridView1.GetDataRow(gridView1.FocusedRowHandle));
            FormForecastReport frm    = new FormForecastReport();

            frm.IsEdit             = true;
            frm.Psp_ForecastReport = report;
            frm.ProjectUID         = ProjectUID;
            frm.Text = "修改预测";

            if (frm.ShowDialog() == DialogResult.OK)
            {
                Itop.Common.DataConverter.ObjectToRow(frm.Psp_ForecastReport, gridView1.GetDataRow(gridView1.FocusedRowHandle));
            }
        }
Esempio n. 2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }

            FormForecastReport frm = new FormForecastReport();

            frm.IsEdit     = false;
            frm.ProjectUID = ProjectUID;
            frm.TypeFlag   = typeFlag;
            frm.Text       = "添加新预测";

            if (frm.ShowDialog() == DialogResult.OK)
            {
                DataRow newRow = dataTable.NewRow();
                Itop.Common.DataConverter.ObjectToRow(frm.Psp_ForecastReport, newRow);
                dataTable.Rows.Add(newRow);

                gridView1.FocusedRowHandle = gridView1.RowCount - 1;
            }
        }