예제 #1
0
        /// <summary>
        /// 还原
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ItemRestore_Click(object sender, EventArgs e)
        {
            UIModels.DataBaseBackInfo _ItemInfo = null;
            if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0)
            {
                _ItemInfo = (DataBaseBackInfo)this._RecordListView.SelectedObjects[0];
            }
            else
            {
                MessageBox.Show("请选中项后再试!");
            }

            ConfirmFrm confirm = new ConfirmFrm("提示", "您确定要还原到所选的版本?", "确定", "取消", 3);

            if (confirm.ShowDialog() == DialogResult.OK)
            {
                backRestoreEnd       = false;
                btnBack.Enabled      = false;
                button3.Enabled      = false;
                SortpanalBar.Visible = true;

                UIBLL.DataBaseBackRestoreManager manager = new DataBaseBackRestoreManager();
                manager.RestoreEndEvent += new DataBaseBackRestoreManager.DelBackRestorStateArg(manager_RestoreEndEvent);
                manager.RestoreByLocalVesion(_ItemInfo);
            }
        }
예제 #2
0
        /// <summary>
        /// 删除项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ItemDel_Click(object sender, EventArgs e)
        {
            UIModels.DataBaseBackInfo _ItemInfo = null;
            if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0)
            {
                _ItemInfo = (DataBaseBackInfo)this._RecordListView.SelectedObjects[0];
            }
            else
            {
                MessageBox.Show("请选中项后再试!");
            }

            ConfirmFrm confirm = new ConfirmFrm("提示", "您确定需要删除此选中项?", "确定", "取消", 3);

            if (confirm.ShowDialog() == DialogResult.OK)
            {
                //1.调用bll,从模块对应的权限列表中移除

                if (UIBLL.DataBackManager.Instance.DelBackRecord(_ItemInfo))
                {
                    RecordList.Remove(_ItemInfo);
                    //从列表中移除

                    //2.从列表中移除
                    this._RecordListView.RemoveObject(_ItemInfo);//将原生从列表中移除
                }
                else
                {
                    MessageBox.Show("操作失败!");
                }
            }
        }