Пример #1
0
        /// <summary>
        /// 修改焦点对象
        /// </summary>
        public void UpdateObject()
        {
            //获取焦点对象
            BurdenLine obj = FocusedObject;

            if (obj == null)
            {
                return;
            }

            //创建对象的一个副本
            BurdenLine objCopy = new BurdenLine();

            DataConverter.CopyTo <BurdenLine>(obj, objCopy);
            FrmBurdenLine v = new  FrmBurdenLine();

            //执行修改操作
            using (FrmBurdenLineDialog dlg = new FrmBurdenLineDialog())
            {
                dlg.Object = objCopy;                   //绑定副本

                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //用副本更新焦点对象
            DataConverter.CopyTo <BurdenLine>(objCopy, obj);
            //刷新表格
            gridControl.RefreshDataSource();
            v.refeshchart();
        }
Пример #2
0
        /// <summary>
        /// �޸Ľ������
        /// </summary>
        public void UpdateObject()
        {
            //��ȡ�������
            BurdenLine obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

            //���������һ������
            BurdenLine objCopy = new BurdenLine();
            DataConverter.CopyTo<BurdenLine>(obj, objCopy);
            FrmBurdenLine v =new  FrmBurdenLine();
            //ִ���޸IJ���
            using (FrmBurdenLineDialog dlg = new FrmBurdenLineDialog())
            {
                dlg.Object = objCopy;   //�󶨸���

                if (dlg.ShowDialog() != DialogResult.OK)
                {

                    return;
                }
            }

            //�ø������½������
            DataConverter.CopyTo<BurdenLine>(objCopy, obj);
            //ˢ�±��
            gridControl.RefreshDataSource();
            v.refeshchart();
        }