Beispiel #1
0
        public void UpdateObject()
        {
            //获取焦点对象
            LineList1 obj = FocusedObject;

            if (obj == null)
            {
                return;
            }

            //创建对象的一个副本


            LineList1 objCopy = new LineList1();

            DataConverter.CopyTo <LineList1>(obj, objCopy);

            //执行修改操作
            using (FrmLineList1Dialog dlg = new FrmLineList1Dialog())
            {
                dlg.Object = objCopy;   //绑定副本
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //用副本更新焦点对象


            DataConverter.CopyTo <LineList1>(objCopy, obj);
            //刷新表格
            gridControl.RefreshDataSource();
        }
Beispiel #2
0
        public void UpdateObject()
        {
            //获取焦点对象
            LineList1 obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

            //创建对象的一个副本

            LineList1 objCopy = new LineList1();
            DataConverter.CopyTo<LineList1>(obj, objCopy);

            //执行修改操作
            using (FrmLineList1Dialog dlg = new FrmLineList1Dialog())
            {
                dlg.Object = objCopy;   //绑定副本
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //用副本更新焦点对象

            DataConverter.CopyTo<LineList1>(objCopy, obj);
            //刷新表格
            gridControl.RefreshDataSource();
        }