コード例 #1
0
        private void btnSelectItemDetails_Click(object sender, EventArgs e)
        {
            // 检测页面数据是否变化
            if (this.IsModfied != null)
            {
                if (this.IsModfied())
                {
                    // 数据有变动是否保存的提示
                    DialogResult myDialogResult = MessageBox.Show(AppMessage.MSG0065, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (myDialogResult == DialogResult.Cancel)
                    {
                        return;
                    }
                }
            }
            // 弹出选择窗口
            FrmItemDetailsTreeSelect myFrmItemDetailsTreeSelect = new FrmItemDetailsTreeSelect();

            myFrmItemDetailsTreeSelect.AllowNull = this.AllowNull;
            if (myFrmItemDetailsTreeSelect.ShowDialog() == DialogResult.OK)
            {
                this.SelectedId = myFrmItemDetailsTreeSelect.SelectedId;
                this.SetParentId(this.SelectedId);
            }
        }
コード例 #2
0
        /// <summary>
        /// 批量移动
        /// </summary>
        private void BatchMove()
        {
            // 判断是否有编辑权限
            if (!this.permissionEdit)
            {
                return;
            }

            // 选择目标节点
            string targetId = string.Empty;
            FrmItemDetailsTreeSelect FrmItemDetailsTreeSelect = new FrmItemDetailsTreeSelect();

            FrmItemDetailsTreeSelect.OldItemDetailsId = this.EntityId;
            FrmItemDetailsTreeSelect.CheckMove        = true;
            FrmItemDetailsTreeSelect.AllowNull        = false;
            // 弹出选择窗体
            if (FrmItemDetailsTreeSelect.ShowDialog() == DialogResult.OK)
            {
                targetId = FrmItemDetailsTreeSelect.SelectedId;
            }
            else
            {
                return;
            }

            // 设置鼠标繁忙状态,并保留原先的状态
            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                if (targetId.Length > 0)
                {
                    DotNetService.Instance.ItemDetailsService.BatchMoveTo(UserInfo, this.TargetTable, this.GetSelecteIds(), targetId);
                    // 绑定屏幕数据
                    this.GetList();
                    if (BaseSystemInfo.ShowInformation)
                    {
                        // 批量保存,进行提示
                        MessageBox.Show(AppMessage.MSG0242, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
        }