Example #1
0
        private void btnDeleteMessage_Click(object sender, EventArgs e)
        {
            dgvList.EndEdit();
            if (!BasePageLogic.CheckInputSelectAnyOne(dgvList, "colSelected"))
            {
                return;
            }
            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0075) != DialogResult.Yes)
            {
                return;
            }

            try
            {
                var returnValue = RDIFrameworkService.Instance.MessageService.SetDeleted(base.UserInfo, BasePageLogic.GetSelecteIds(this.dgvList, CiMessageTable.FieldId, "colSelected", true));
                if (returnValue <= 0 || !SystemInfo.ShowSuccessMsg)
                {
                    return;
                }
                MessageBoxHelper.ShowSuccessMsg(string.Format(RDIFrameworkMessage.MSG0077, returnValue.ToString(CultureInfo.InvariantCulture)));
                this.GetMessageListByFunctionCode();
            }
            catch (Exception exception)
            {
                this.ProcessException(exception);
            }
        }
Example #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
            if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
            {
                return;
            }
            if (!CheckInput())
            {
                return;
            }

            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0075) == DialogResult.Yes)
            {
                try
                {
                    var returnValue = roleService.SetDeleted(base.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, PiUserTable.FieldId, "colSelected", true));
                    if (returnValue > 0 && SystemInfo.ShowSuccessMsg)
                    {
                        MessageBoxHelper.ShowSuccessMsg(string.Format(RDIFrameworkMessage.MSG0077, returnValue.ToString()));
                        this.FormOnLoad(false);
                    }
                }
                catch (Exception exception)
                {
                    this.ProcessException(exception);
                }
            }
        }
Example #3
0
        private void btnRemoveUser_Click(object sender, EventArgs e)
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                return;
            }
            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0075) != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                this.BatchRemove();
                this.Changed = true;
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
        }
Example #4
0
 private void btnDeleteData_Click(object sender, EventArgs e)
 {
     dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
     if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
     {
         return;
     }
     if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) == System.Windows.Forms.DialogResult.Yes)
     {
         try
         {
             var statusMessage = string.Empty;
             var returnValue   = itemDetailService.SetDeleted(this.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, CiItemDetailsTable.FieldId, "colSelected", true));
             if (returnValue > 0)
             {
                 if (SystemInfo.ShowSuccessMsg)
                 {
                     MessageBoxHelper.ShowSuccessMsg(string.Format(RDIFrameworkMessage.MSG0077, returnValue.ToString()));
                     pageDataDictionaryManagement.Bind();
                 }
             }
             else
             {
                 MessageBoxHelper.ShowWarningMsg(RDIFrameworkMessage.MSG3020);
             }
         }
         catch (Exception exception)
         {
             this.ProcessException(exception);
         }
     }
 }
Example #5
0
        private void Delete()
        {
            dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
            if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
            {
                return;
            }
            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) != DialogResult.Yes)
            {
                return;
            }
            try
            {
                var statusMessage = string.Empty;
                var returnValue   = RDIFrameworkService.Instance.LogService.BatchDelete(this.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, CiLogTable.FieldId, "colSelected", true));

                if (returnValue > 0)
                {
                    if (SystemInfo.ShowSuccessMsg)
                    {
                        MessageBoxHelper.ShowSuccessMsg(string.Format(RDIFrameworkMessage.MSG0077, returnValue.ToString()));
                        this.QueryLog();
                    }
                }
                else
                {
                    MessageBoxHelper.ShowWarningMsg(statusMessage);
                }
            }
            catch (Exception exception)
            {
                this.ProcessException(exception);
            }
        }
Example #6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
            if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
            {
                return;
            }
            if (!CheckInput())
            {
                return;
            }

            if (MessageBoxHelper.Show("\n你确定删除所选用户吗?(是/否)") != DialogResult.Yes)
            {
                return;
            }

            try
            {
                var returnValue = RDIFrameworkService.Instance.UserService.SetDeleted(base.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, PiUserTable.FieldId, "colSelected", true));
                if (returnValue > 0 && SystemInfo.ShowSuccessMsg)
                {
                    MessageBoxHelper.ShowSuccessMsg("温馨提示:共删除【" + returnValue.ToString(CultureInfo.InvariantCulture) + "】条用户数据!");
                    this.Search(true);
                }
            }
            catch (Exception exception)
            {
                this.ProcessException(exception);
            }
        }
Example #7
0
        private void btnSetPassword_Click(object sender, EventArgs e)
        {
            dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
            if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
            {
                return;
            }
            if (!CheckInput())
            {
                return;
            }

            //此处还要做判断,超级管理员才能做批量修改(即可选择多个用户同时修改其密码为统一密码)。

            var userIds = BasePageLogic.GetSelecteIds(this.dgvInfo, PiUserTable.FieldId, "colSelected", true);

            if (userIds.Length > 1 && MessageBoxHelper.Show("确认批量设置所选用户的密码吗?") == System.Windows.Forms.DialogResult.No)
            {
                return;
            }

            var userPassword = new FrmUserPassword(userIds);

            userPassword.ShowDialog();
        }
Example #8
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvTargetResource, "colSelected"))
            {
                return;
            }
            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0075) != DialogResult.Yes)
            {
                return;
            }

            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                int result = this.BatchRemove();
                this.GetUserOrganizeList();
                this.SetControlState();
                if (SystemInfo.ShowInformation)
                {
                    MessageBoxHelper.ShowSuccessMsg(RDIFrameworkMessage.Format(RDIFrameworkMessage.MSG0077, result.ToString()));
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                this.Cursor = holdCursor;
            }
        }
Example #9
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
            if (BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
            {
                if (!CheckInput())
                {
                    return;
                }

                if (MessageBoxHelper.Show("你确定所选数据吗?(是/否)") == System.Windows.Forms.DialogResult.Yes)
                {
                    try
                    {
                        int returnValue = RDIFrameworkService.Instance.PlatFormAddInService.SetDeleted(base.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, CiDbLinkDefineTable.FieldId, "colSelected", true));
                        if (returnValue > 0)
                        {
                            if (SystemInfo.ShowSuccessMsg)
                            {
                                MessageBoxHelper.ShowSuccessMsg("共删除【" + returnValue.ToString() + "】条数据!");
                                this.BindData();
                            }
                        }
                    }
                    catch (Exception exception)
                    {
                        this.ProcessException(exception);
                    }
                }
            }
        }
Example #10
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>影响行数</returns>
        public int Delete()
        {
            int result = 0;

            if (BasePageLogic.CheckInputSelectAnyOne(dgvData, "colSelected"))
            {
                if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) == DialogResult.Yes)
                {
                    // 设置鼠标繁忙状态,并保留原先的状态
                    Cursor holdCursor = this.Cursor;
                    this.Cursor = Cursors.WaitCursor;
                    try
                    {
                        result = RDIFrameworkService.Instance.SequenceService.SetDeleted(UserInfo, this.EntityId);
                        // 加载窗体
                        this.GetList();
                    }
                    catch (Exception ex)
                    {
                        this.ProcessException(ex);
                    }
                    finally
                    {
                        // 设置鼠标默认状态,原来的光标状态
                        this.Cursor = holdCursor;
                    }
                }
            }
            return(result);
        }
Example #11
0
 /// <summary>
 /// 删除字典明细
 /// </summary>
 private void DeleteItemDetals()
 {
     dgvInfo.EndEdit(); //此句非常关键,必须结束DataGridView的修改,才能得到其真实的值。
     if (!BasePageLogic.CheckInputSelectAnyOne(dgvInfo, "colSelected"))
     {
         return;
     }
     if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) == System.Windows.Forms.DialogResult.Yes)
     {
         try
         {
             var returnValue = RDIFrameworkService.Instance.ItemDetailsService.SetDeleted(this.UserInfo, BasePageLogic.GetSelecteIds(this.dgvInfo, CiItemDetailsTable.FieldId, "colSelected", true));
             if (returnValue > 0)
             {
                 if (SystemInfo.ShowSuccessMsg)
                 {
                     MessageBoxHelper.ShowSuccessMsg(string.Format(RDIFrameworkMessage.MSG0077, returnValue.ToString()));
                     this.GetItemsDetailList();
                 }
             }
             else
             {
                 MessageBoxHelper.ShowWarningMsg(RDIFrameworkMessage.MSG3020);
             }
         }
         catch (Exception exception)
         {
             this.ProcessException(exception);
         }
     }
 }
Example #12
0
 private void btnSelect_Click(object sender, EventArgs e)
 {
     if (this.MultiSelect)
     {
         if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvRole, "colSelected"))
         {
             return;
         }
         this.SelectedIds  = this.GetSelectedIds();
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         if (!BasePageLogic.CheckInputSelectOne(this.dgvRole, "colSelected"))
         {
             return;
         }
         var dataRow = BasePageLogic.GetSelecteRow(this.dgvRole, "colSelected") ??
                       BasePageLogic.GetDataGridViewEntity(this.dgvRole);
         if (dataRow != null)
         {
             this.GetSelectedId(dataRow);
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     }
 }
Example #13
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>影响行数</returns>
        public int Delete()
        {
            int result = 0;

            if (BasePageLogic.CheckInputSelectAnyOne(dgvRole, "colSelected"))
            {
                if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) == DialogResult.Yes)
                {
                    // 设置鼠标繁忙状态,并保留原先的状态
                    Cursor holdCursor = this.Cursor;
                    this.Cursor = Cursors.WaitCursor;
                    try
                    {
                        result = this.BatchDelete();
                    }
                    catch (Exception ex)
                    {
                        this.ProcessException(ex);
                    }
                    finally
                    {
                        // 设置鼠标默认状态,原来的光标状态
                        this.Cursor = holdCursor;
                    }
                }
            }
            return(result);
        }
        /// <summary>
        /// 批量移动
        /// </summary>
        private void BatchMove()
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                return;
            }
            var frmOrganizeSelect = new FrmOrganizeSelect(this.ParentEntityId, this.chkInnerOrganize.Checked);

            if (UserInfo.IsAdministrator)
            {
                frmOrganizeSelect.AllowNull = true;
            }
            else
            {
                frmOrganizeSelect.AllowNull           = false;
                frmOrganizeSelect.PermissionScopeCode = this.PermissionItemScopeCode;
            }
            frmOrganizeSelect.OnButtonConfirmClick += new BusinessLogic.CheckMoveEventHandler(CheckInputMove);
            if (frmOrganizeSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor     = Cursors.WaitCursor;
            this.FormLoaded = false;
            RDIFrameworkService.Instance.OrganizeService.BatchMoveTo(UserInfo, this.GetSelecteIds(), frmOrganizeSelect.SelectedId);
            //if ((SystemInfo.ClientCache) && (this.chkRefresh.Checked))
            //{
            //    ClientCache.Instance.DTOrganize = null;
            //}
            this.ParentEntityId = frmOrganizeSelect.SelectedId;
            // 调用事件
            var tags = this.GetSelecteIds();

            RDIFrameworkService.Instance.OrganizeService.BatchMoveTo(UserInfo, tags, frmOrganizeSelect.SelectedId);
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvOrganize, frmOrganizeSelect.SelectedId);
            var parentNode = BasePageLogic.TargetNode;

            if (tags.Length > 0)
            {
                foreach (string tmpTag in tags)
                {
                    BasePageLogic.FindTreeNode(this.tvOrganize, tmpTag);
                    BasePageLogic.MoveTreeNode(this.tvOrganize, BasePageLogic.TargetNode, parentNode);
                }
            }
            // 绑定grdOrganize
            this.GetOrganizeList();
            if (this.DTOrganizeList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTOrganizeList.Rows.Count - 1;
            }
            this.FormLoaded = true;
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }
Example #15
0
        /// <summary>
        /// 移动数据
        /// </summary>
        private void MoveObject()
        {
            if (this.LastControl == this.dgvInfo && BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                this.BatchMove();
            }

            if (this.LastControl == this.tvOrganize && this.parentEntityId.Length > 0)
            {
                this.SingleMove(this.CurrentEntityId);
            }
        }
Example #16
0
        /// <summary>
        /// 批量移动
        /// </summary>
        private void BatchMove()
        {
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
            {
                return;
            }

            frmModuleSelect = new FrmModuleSelect(this.ParentEntityId)
            {
                AllowNull = true
            };
            frmModuleSelect.OnButtonConfirmClick += new FrmModuleSelect.ButtonConfirmEventHandler(CheckInputMove);
            if (frmModuleSelect.ShowDialog() != DialogResult.OK)
            {
                return;
            }

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

            this.Cursor         = Cursors.WaitCursor;
            this.ParentEntityId = frmModuleSelect.SelectedId;
            // 调用事件
            var tags = this.GetSelecteIds();

            moduleService.BatchMoveTo(UserInfo, tags, frmModuleSelect.SelectedId);
            // 移动treeNode
            BasePageLogic.FindTreeNode(this.tvModule, frmModuleSelect.SelectedId);
            var parentNode = BasePageLogic.TargetNode;

            if (tags.Length > 0)
            {
                foreach (string tmpTag in tags)
                {
                    BasePageLogic.FindTreeNode(this.tvModule, tmpTag);
                    BasePageLogic.MoveTreeNode(this.tvModule, BasePageLogic.TargetNode, parentNode);
                }
            }
            // 绑定dgvInfo
            this.GetModuleList();
            if (this.DTModuleList.Rows.Count > 0)
            {
                this.dgvInfo.FirstDisplayedScrollingRowIndex = this.DTModuleList.Rows.Count - 1;
            }
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;
        }
Example #17
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>影响行数</returns>
        public int Delete()
        {
            var returnValue = 0;

            if (this.LastControl == this.dgvInfo)
            {
                // 检查批量输入的有效性
                if (BasePageLogic.CheckInputSelectAnyOne(this.dgvInfo, "colSelected"))
                {
                    returnValue = this.BatchDelete();
                }
            }

            if (this.LastControl == this.tvModule)
            {
                returnValue = this.SingleDelete();
            }
            return(returnValue);
        }
        private int DeleteCondition()
        {
            int iResult = 0;

            // 检查至少要选择一个?
            if (!BasePageLogic.CheckInputSelectAnyOne(this.dgvTable, "colSelected"))
            {
                return(iResult);
            }
            // 是否确认删除了?
            if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) != DialogResult.Yes)
            {
                return(iResult);
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                string[] ids = BasePageLogic.GetSelecteIds(this.dgvTable, PiPermissionScopeTable.FieldId, "colSelected", true);

                iResult = RDIFrameworkService.Instance.TableColumnsService.BatchDeleteConstraint(this.UserInfo, ids);
                // 重新加载数据,先刷新屏幕,再显示提示信息
                this.FormOnLoad();
                // 是否需要有提示信息?
                if (SystemInfo.ShowInformation)
                {
                    // 批量保存,进行提示
                    MessageBoxHelper.ShowSuccessMsg(RDIFrameworkMessage.Format(RDIFrameworkMessage.MSG0077, iResult.ToString()));
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
            return(iResult);
        }
 /// <summary>
 /// 选择用户
 /// </summary>
 /// <param name="close">关闭窗体</param>
 private void SelectMulti(bool close = true)
 {
     if (BasePageLogic.CheckInputSelectAnyOne(this.DTUserList, BusinessLogic.SelectedColumn))
     {
         this.SelectedIds      = this.GetSelectedIds();
         this.SelectedFullName = BusinessLogic.ObjectsToList(this.GetSelectedFullNames());
         if (!close)
         {
             if (this.OnSelected != null)
             {
                 // 进行委托处理
                 if (this.OnSelected(this.SelectedIds))
                 {
                     this.RemoveUser(this.SelectedIds);
                     this.SelectedIds = null;
                 }
                 // 清除选中的数据
                 return;
             }
         }
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }