Beispiel #1
0
        /// <summary>
        /// �޸Ľ������
        /// </summary>
        public void UpdateObject()
        {
            //��ȡ�������
            PSP_EachList obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

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

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

            //�ø������½������
            DataConverter.CopyTo<PSP_EachList>(objCopy, obj);
            //ˢ�±��
            gridControl.RefreshDataSource();
        }
Beispiel #2
0
        /// <summary>
        /// ��Ӷ���
        /// </summary>
        /// 
        public void AddObjecta(string type, bool bl)
        {
            //�����������Ƿ��Ѿ�����
            if (ObjectList == null)
            {
                return;
            }
            //�½�����
            PSP_EachList obj = new PSP_EachList();
            obj.Types = type;
            obj.CreateDate = DateTime.Now;

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

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

            //ˢ�±�񣬲��������ж�λ���¶����ϡ�
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
Beispiel #3
0
        /// <summary>
        /// ˢ�±���е�����
        /// </summary>
        /// <returns>ture:�ɹ�  false:ʧ��</returns>
        public bool RefreshData(string type)
        {
            try
            {
                 PSP_EachList pe=new PSP_EachList();
                pe.Types=type;

                IList<PSP_EachList> list = Services.BaseService.GetList<PSP_EachList>("SelectPSP_EachListByTypes", pe);
                this.gridControl.DataSource = list;
            }
            catch (Exception exc)
            {
                Debug.Fail(exc.Message);
                HandleException.TryCatch(exc);
                return false;
            }

            return true;
        }