コード例 #1
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);
                }
            }
        }
コード例 #2
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);
         }
     }
 }
コード例 #3
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();
        }
コード例 #4
0
        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);
        }
コード例 #5
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);
            }
        }
コード例 #6
0
 /// <summary>
 /// 获得已被选择的部门主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetSelecteIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvRole, PiOrganizeTable.FieldId, "colSelected", true));
 }
コード例 #7
0
 /// <summary>
 /// 获得未被选择的主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetUnSelectedIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvTargetResource, "Id", "colSelected", false));
 }
コード例 #8
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);
                    }
                }
            }
        }
コード例 #9
0
 /// <summary>
 /// 获得已被选中主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetSelecteIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvTargetResource, PiUserOrganizeTable.FieldId, "colSelected", true));
 }
コード例 #10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (this.LastControl == dgvInfo)
            {
                var returnValue = 0;
                if (this.CheckInputBatchDelete() &&
                    MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) == System.Windows.Forms.DialogResult.Yes)
                {
                    if (!SystemInfo.ClientCache)
                    {
                        ClientCache.Instance.DTOrganize = null;
                    }

                    this.FormLoaded = false;
                    // 绑定数据
                    var tags = BasePageLogic.GetSelecteIds(this.dgvInfo, PiOrganizeTable.FieldId, "colSelected", true);
                    returnValue = organizationService.SetDeleted(UserInfo, tags);
                    if (SystemInfo.ClientCache)
                    {
                        ClientCache.Instance.DTOrganize = null;
                    }
                    // 获取列表
                    this.DTOrganize = organizationService.GetDT(UserInfo);
                    // 在tree删除相应的节点
                    BasePageLogic.BatchRemoveNode(this.tvOrganize, tags);
                    // 绑定grdModule
                    this.GetOrganizeList();
                    this.FormLoaded = true;
                }
            }
            else
            {
                var returnValue = 0;
                if (this.tvOrganize.SelectedNode == null)
                {
                    returnValue = 0;
                    return;
                }
                // 设置鼠标繁忙状态,并保留原先的状态
                var holdCursor = this.Cursor;
                this.Cursor     = Cursors.WaitCursor;
                this.FormLoaded = false;
                try
                {
                    if (!BasePageLogic.NodeAllowDelete(this.tvOrganize.SelectedNode))
                    {
                        MessageBoxHelper.ShowWarningMsg(string.Format(RDIFrameworkMessage.MSG0035, BasePageLogic.TargetNode.Text));
                    }
                    else
                    {
                        if (MessageBoxHelper.Show(RDIFrameworkMessage.MSG0015) != System.Windows.Forms.DialogResult.Yes)
                        {
                            return;
                        }
                        returnValue = organizationService.SetDeleted(UserInfo, new String[] { this.ParentEntityId });
                        if (SystemInfo.ClientCache)
                        {
                            ClientCache.Instance.DTOrganize = null;
                        }
                        if (returnValue <= 0)
                        {
                            return;
                        }
                        string[] tags = { ((DataRow)this.tvOrganize.SelectedNode.Tag)[PiOrganizeTable.FieldId].ToString() };
                        BasePageLogic.BatchRemoveNode(this.tvOrganize, tags);
                        // 绑定grdOrganize
                        this.GetOrganizeList();
                    }
                }
                catch (Exception ex)
                {
                    this.ProcessException(ex);
                }
                finally
                {
                    // 设置鼠标默认状态,原来的光标状态
                    this.FormLoaded = true;
                    this.Cursor     = holdCursor;
                }
            }
        }
コード例 #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);
         }
     }
 }
コード例 #12
0
 /// <summary>
 /// 获得已被选中主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetSelecteIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvList, QueryEngineDefineTable.FieldId, "colSelected", true));
 }
コード例 #13
0
 /// <summary>
 /// 获得已被选择的模块主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetSelecteIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvInfo, PiModuleTable.FieldId, "colSelected", true));
 }
コード例 #14
0
 /// <summary>
 /// 获得未被选择的主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetRoleUnSelectedIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvRole, "Id", "colRoleSelected", false));
 }
コード例 #15
0
 /// <summary>
 /// 获得未被选择的主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetUserUnSelectedIds()
 {
     return(BasePageLogic.GetSelecteIds(this.dgvUser, "Id", "colUserSelected", false));
 }
コード例 #16
0
 /// <summary>
 /// 获得已被选择的权限主键数组
 /// </summary>
 /// <returns>主键组</returns>
 private string[] GetSelectedIds()
 {
     return(BasePageLogic.GetSelecteIds(this.DTUserList.DefaultView, PiUserTable.FieldId, BusinessLogic.SelectedColumn, true));
 }
コード例 #17
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);
            }
        }
コード例 #18
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);
            }
        }
コード例 #19
0
 /// <summary>
 /// 获得已被选择的部门主键数组
 /// </summary>
 /// <returns>主键数组</returns>
 private string[] GetSelecteIds()
 {
     dgvInfo.EndEdit();
     return(BasePageLogic.GetSelecteIds(this.dgvInfo, PiOrganizeTable.FieldId, "colSelected", true));
 }