Esempio n. 1
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.TypeFlag = typeFlag;
            frm.Text     = "添加项目计划表名称";
            //  frm.TypeText = "负荷";

            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;
            }
        }
Esempio n. 2
0
        private void EditReport()
        {
            if (gridView1.FocusedRowHandle < 0)
            {
                return;
            }

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

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

            frm.IsEdit             = true;
            frm.Psp_ForecastReport = report;
            frm.Text = "修改项目计划表";
            if (frm.ShowDialog() == DialogResult.OK)
            {
                Itop.Common.DataConverter.ObjectToRow(frm.Psp_ForecastReport, gridView1.GetDataRow(gridView1.FocusedRowHandle));
            }
        }
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!base.AddRight)
            {
                MsgBox.Show("您没有权限进行此项操作!");
                return;
            }

            FormForecastReport frm = new FormForecastReport();
            frm.IsEdit = false;
            frm.TypeFlag = typeFlag;
            frm.Text = "添加项目计划表名称";
              //  frm.TypeText = "负荷";

            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;
            }
        }
        private void EditReport()
        {
            if (gridView1.FocusedRowHandle < 0)
            {
                return;
            }

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

            PowerEachList report = Itop.Common.DataConverter.RowToObject<PowerEachList>(gridView1.GetDataRow(gridView1.FocusedRowHandle));
            FormForecastReport frm = new FormForecastReport();
            frm.IsEdit = true;
            frm.Psp_ForecastReport = report;
            frm.Text = "修改项目计划表";
            if (frm.ShowDialog() == DialogResult.OK)
            {
                Itop.Common.DataConverter.ObjectToRow(frm.Psp_ForecastReport, gridView1.GetDataRow(gridView1.FocusedRowHandle));
            }
        }