Beispiel #1
0
        /// <summary>
        /// 添加对象
        /// </summary>
        public void AddObject()
        {
            //检查对象链表是否已经加载
            if (ObjectList == null)
            {
                return;
            }
            //新建对象
            Ps_Volume obj = new Ps_Volume();

            //执行添加操作
            using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
            {
                dlg.IsCreate = true;                    //设置新建标志
                dlg.Object   = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //将新对象加入到链表中
            ObjectList.Add(obj);

            //刷新表格,并将焦点行定位到新对象上。
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
Beispiel #2
0
 protected override void Add()
 {
     //�½�����
     Ps_Volume obj = new Ps_Volume();
     obj.ID = Guid.NewGuid().ToString();
     //ִ����Ӳ���
     using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
     {
         dlg.IsCreate = true;    //�����½���־
         dlg.Object = obj;
         if (dlg.ShowDialog() != DialogResult.OK)
         {
             return;
         }
     }
     InitData();
 }
Beispiel #3
0
        protected override void Add()
        {
            //新建对象
            Ps_Volume obj = new Ps_Volume();

            obj.ID = Guid.NewGuid().ToString();
            //执行添加操作
            using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
            {
                dlg.IsCreate = true;    //设置新建标志
                dlg.Object   = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }
            InitData();
        }
Beispiel #4
0
        /// <summary>
        /// ��Ӷ���
        /// </summary>
        public void AddObject()
        {
            //�����������Ƿ��Ѿ�����
            if (ObjectList == null)
            {
                return;
            }
            //�½�����
            Ps_Volume obj = new Ps_Volume();

            //ִ����Ӳ���
            using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
            {
                dlg.IsCreate = true;    //�����½���־
                dlg.Object = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //���¶�����뵽������
            ObjectList.Add(obj);

            //ˢ�±�񣬲��������ж�λ���¶����ϡ�
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
Beispiel #5
0
        /// <summary>
        /// �޸Ľ������
        /// </summary>
        public void UpdateObject()
        {
            //��ȡ�������
            Ps_Volume obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

            //���������һ������
            Ps_Volume objCopy = new Ps_Volume();
            DataConverter.CopyTo<Ps_Volume>(obj, objCopy);

            //ִ���޸IJ���
            using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
            {
                dlg.Object = objCopy;   //�󶨸���
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //�ø������½������
            DataConverter.CopyTo<Ps_Volume>(objCopy, obj);
            //ˢ�±��
            gridControl.RefreshDataSource();
        }
Beispiel #6
0
        protected override void Edit()
        {
            DevExpress.XtraGrid.Columns.GridColumn gc = this.gridView1.FocusedColumn;
            if (gc.FieldName.IndexOf("Y") < 0)
                return;

            Ps_Volume obj=null;
            foreach (Ps_Volume pv in list)
            {
                if (pv.Years == Convert.ToInt32(gc.FieldName.Replace("Y", "")))
                { obj = pv; break; }

            }
            if (obj == null)
            {
                return;
            }

            //ִ���޸IJ���
            using (FrmPs_VolumeDialog dlg = new FrmPs_VolumeDialog())
            {
                dlg.Object = obj;   //�󶨸���
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }
            InitData();
        }