Exemple #1
0
        public override void Add()
        {
            frmDXXHdlg dlg = new frmDXXHdlg();

            if (dlg.ShowDialog() == DialogResult.OK) {
                //���Ӽ�¼
                WireCategory dev = dlg.DeviceMx;
                DataService.Create<WireCategory>(dev);
                DataRow row = datatable1.NewRow();
                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
Exemple #2
0
        public override void Add()
        {
            frmDXXHdlg dlg = new frmDXXHdlg();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                //增加记录
                WireCategory dev = dlg.DeviceMx;
                DataService.Create <WireCategory>(dev);
                DataRow row = datatable1.NewRow();
                Itop.Common.DataConverter.ObjectToRow(dev, row);
                datatable1.Rows.Add(row);
            }
        }
Exemple #3
0
 public override void Edit()
 {
     frmDXXHdlg dlg = new frmDXXHdlg();
     DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
     if (row != null) {
         WireCategory dev = Itop.Common.DataConverter.RowToObject<WireCategory>(row);
         dlg.DeviceMx = dev;
         if (dlg.ShowDialog() == DialogResult.OK) {
             //���¼�¼
             dev = dlg.DeviceMx;
             DataService.Update<WireCategory>(dev);
             Itop.Common.DataConverter.ObjectToRow(dev, row);
         }
     }
 }
Exemple #4
0
        public override void Edit()
        {
            frmDXXHdlg dlg = new frmDXXHdlg();
            DataRow    row = gridView1.GetDataRow(gridView1.FocusedRowHandle);

            if (row != null)
            {
                WireCategory dev = Itop.Common.DataConverter.RowToObject <WireCategory>(row);
                dlg.DeviceMx = dev;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    //更新记录
                    dev = dlg.DeviceMx;
                    DataService.Update <WireCategory>(dev);
                    Itop.Common.DataConverter.ObjectToRow(dev, row);
                }
            }
        }