Exemple #1
0
        private void SetVoteButtonStatus()
        {
            if (this.lcgVote.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Never)
            {
                return;
            }

            if (this.chkAdminVeto.Checked && this.lciAdminVeto.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always)
            {
                var adminVetoInfo = _IDService.GetIDOperationVoteAdminVetoInfo(OperateNo);

                if (adminVetoInfo == null || adminVetoInfo.Flag == (int)EnumLibrary.IDVoteFlag.None)
                {
                    this.btnApproval.Enabled = true;
                    this.btnOppose.Enabled   = true;
                    this.btnRevoke.Enabled   = false;
                }
                else
                {
                    this.btnApproval.Enabled = false;
                    this.btnOppose.Enabled   = false;
                    this.btnRevoke.Enabled   = true;
                }
            }
            else
            {
                var myVoteInfo = _IDService.GetIDOperationVoteInfo(LoginInfo.CurrentUser.UserCode, OperateNo);

                //未投票
                if (myVoteInfo == null || myVoteInfo.Flag == (int)EnumLibrary.IDVoteFlag.None)
                {
                    this.btnAbstain.Enabled  = true;
                    this.btnApproval.Enabled = true;
                    this.btnOppose.Enabled   = true;
                    this.btnRevoke.Enabled   = false;
                }
                //已投票
                else
                {
                    this.btnAbstain.Enabled  = false;
                    this.btnApproval.Enabled = false;
                    this.btnOppose.Enabled   = false;
                    //决策交易操作记录操作者
                    if (myVoteInfo.Type == (int)EnumLibrary.IDVoteType.Applicant)
                    {
                        this.btnRevoke.Enabled = false;
                    }
                    else
                    {
                        this.btnRevoke.Enabled = true;
                    }
                }
            }
        }