Esempio n. 1
0
        public override void Add()
        {
            frmDYdlg dlg = new frmDYdlg();
            dlg.ProjectID = Itop.Client.MIS.ProgUID;
            dlg.czButtonVisble(true);
            dlg.Name = "";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //���Ӽ�¼
                PSP_PowerSubstation_Info dev = dlg.DeviceMx;
                dev.AreaID = Itop.Client.MIS.ProgUID;
                if (dlg.bcflag)  //˵���Ѿ�����
                {
                    DataService.Update<PSP_PowerSubstation_Info>(dev);
                }
                else
                    DataService.Create<PSP_PowerSubstation_Info>(dev);
                DataRow row = datatable1.NewRow();
                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
            else {
            if (dlg.bcflag)
            {
                //���Ӽ�¼
                PSP_PowerSubstation_Info dev = dlg.DeviceMx;
                dev.AreaID = Itop.Client.MIS.ProgUID;

            }
            }
        }
Esempio n. 2
0
        public override void Add()
        {
            frmDYdlg dlg = new frmDYdlg();

            dlg.ProjectID = Itop.Client.MIS.ProgUID;
            dlg.czButtonVisble(true);
            dlg.Name = "";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                PSP_PowerSubstation_Info dev = dlg.DeviceMx;
                dev.AreaID = Itop.Client.MIS.ProgUID;
                if (dlg.bcflag)  //说明已经创建
                {
                    DataService.Update <PSP_PowerSubstation_Info>(dev);
                }
                else
                {
                    DataService.Create <PSP_PowerSubstation_Info>(dev);
                }
                DataRow row = datatable1.NewRow();
                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
            else
            {
                if (dlg.bcflag)
                {
                    //增加记录
                    PSP_PowerSubstation_Info dev = dlg.DeviceMx;
                    dev.AreaID = Itop.Client.MIS.ProgUID;
                }
            }
        }
Esempio n. 3
0
        public override void Edit()
        {
            frmDYdlg dlg = new frmDYdlg();

            dlg.czButtonVisble(true);
            DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);

            if (row != null)
            {
                PSP_PowerSubstation_Info dev = Itop.Common.DataConverter.RowToObject <PSP_PowerSubstation_Info>(row);
                dlg.DeviceMx = dev;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //更新记录
                    dev        = dlg.DeviceMx;
                    dev.AreaID = this.ProjectID;
                    DataService.Update <PSP_PowerSubstation_Info>(dev);
                    Itop.Common.DataConverter.ObjectToRow(dev, row);
                }
            }
        }
Esempio n. 4
0
 public override void Edit()
 {
     frmDYdlg dlg = new frmDYdlg();
     dlg.czButtonVisble(true);
     DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
     if (row != null)
     {
         PSP_PowerSubstation_Info dev = Itop.Common.DataConverter.RowToObject<PSP_PowerSubstation_Info>(row);
         dlg.DeviceMx = dev;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             //���¼�¼
             dev = dlg.DeviceMx;
             dev.AreaID = this.ProjectID;
             DataService.Update<PSP_PowerSubstation_Info>(dev);
             Itop.Common.DataConverter.ObjectToRow(dev, row);
         }
     }
 }