protected void GVBoardDischargeInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int  iJudgementValue  = 0;
        long lBoardSequenceID = long.Parse(Session["BoardMemberID"].ToString());

        string sBoardDischargeID = e.CommandArgument.ToString();
        long   lBoardDischargeID = long.Parse(sBoardDischargeID.Substring(0, sBoardDischargeID.Length - 1));

        BoardInfoBusiness BoardInfo = new BoardInfoBusiness();
        int iReturnValue            = int.Parse(BoardInfo.BoardMemberDischargeVoteExistJudgement(lBoardDischargeID, lBoardSequenceID).ToString());

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('您已投过票!')</script>");
        }
        else
        {
            if (sBoardDischargeID[sBoardDischargeID.Length - 1] == 'Y')
            {
                iJudgementValue = BoardInfo.BoardMemberDischargeResult(lBoardDischargeID, lBoardSequenceID, "Y");
                if (iJudgementValue > 0)
                {
                    Response.Write("<script>alert('赞同票投票成功!')</script>");
                }
            }
            else
            {
                iJudgementValue = BoardInfo.BoardMemberDischargeResult(lBoardDischargeID, lBoardSequenceID, "N");
                if (iJudgementValue > 0)
                {
                    Response.Write("<script>alert('反对票投票成功!')</script>");
                }
            }
        }
    }
    protected void GVBoardApplyInfo_RowCommand1(object sender, GridViewCommandEventArgs e)
    {
        //先查该董事会成员是否已经投票
        int               iJudgementValue      = 0;
        long              lBoardSequenceID     = long.Parse(Session["BoardMemberID"].ToString());
        string            sBoardDesitionResult = e.CommandArgument.ToString();
        long              lBoardApplyID        = long.Parse(sBoardDesitionResult.Substring(0, sBoardDesitionResult.Length - 1));
        BoardInfoBusiness BoardApplyResult     = new BoardInfoBusiness();
        int               iReturnValue         = int.Parse(BoardApplyResult.BoardMemberVotedExistJudgement(lBoardSequenceID, lBoardApplyID).ToString());

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('您已投票!')</script>");
        }
        else
        {
            if (sBoardDesitionResult[sBoardDesitionResult.Length - 1] == 'Y')
            {
                iJudgementValue = BoardApplyResult.BoardApplyResult(lBoardApplyID, lBoardSequenceID, 'Y');
                if (iJudgementValue > 0)
                {
                    Response.Write("<script>alert('赞同票投票成功!')</script>");
                }
            }
            else
            {
                iJudgementValue = BoardApplyResult.BoardApplyResult(lBoardApplyID, lBoardSequenceID, 'N');
                if (iJudgementValue > 0)
                {
                    Response.Write("<script>alert('反对票投票成功!')</script>");
                }
            }
        }
    }
    private string RandomString()
    {
        Random        AmountRandom    = new Random();//决定字符串的长度
        int           iAmountRandom   = AmountRandom.Next(10, 15);
        StringBuilder RandomSecretKEY = new StringBuilder();

        Random ASCIIRandom = new Random();//随机决定字符

        for (int iCounter = 0; iCounter <= iAmountRandom; iCounter++)
        {
            int  iASCIIRandom = ASCIIRandom.Next(33, 126);
            char cASCIIRandom = (char)iASCIIRandom;
            RandomSecretKEY.Append(cASCIIRandom);
        }
        string sRandomSecretKEY = RandomSecretKEY.ToString();

        BoardInfoBusiness BoardKEYExist = new BoardInfoBusiness();

        if ((int)BoardKEYExist.BoardKeyExistJudgement(sRandomSecretKEY) > 0)
        {
            return(RandomString());
        }
        else
        {
            return(sRandomSecretKEY);
        }
    }
    protected void BTNAdminInfoResetConfirm_Click(object sender, EventArgs e)
    {
        /**
         * 根据需求,Click产生不同状态
         */

        AdminInfoBusiness AdminInfoBusiness = new AdminInfoBusiness();
        AdminInfoEntity   AdminInfo         = new AdminInfoEntity();

        AdminInfo = AdminInfoBusiness.GetAdminInfoByAdminAccount();
        if (AdminInfo.iadminInfoHackedThreateningLevel == 3)
        {
            BoardInfoBusiness BoardInfoBusiness = new BoardInfoBusiness();
            if ((int)BoardInfoBusiness.BoardKeyExistJudgement(TBBoardKey.Text) > 0)
            {
                LBLSolution.Text               = "请重置管理员的信息";
                TBBoardKey.Visible             = false;
                TBResetAccount.Visible         = true;
                TBResetPassword.Visible        = true;
                TBResetPasswordConfirm.Visible = true;
            }
            else
            {
                LBLWarningLevel.Text           = "三级警告!";
                LBLSolution.Text               = "请通知任一董事会成员输入密钥以解锁";
                TBResetAccount.Visible         = false;
                TBResetPassword.Visible        = false;
                TBResetPasswordConfirm.Visible = false;
            }
        }

        else if (AdminInfo.iadminInfoHackedThreateningLevel == 4)
        {
            BoardInfoBusiness BoardInfoBusiness = new BoardInfoBusiness();
            int iBoardMemberAmount = int.Parse(BoardInfoBusiness.GetAllBoardMemberAmount().ToString());

            BoardKeyMethod(TBBoardKey.Text, iBoardMemberAmount);

            if (int.Parse(ViewState["SuccessTimes"].ToString()) < iBoardMemberAmount)
            {
                LBLWarningLevel.Text           = "四级警告!";
                LBLSolution.Text               = "请通知任一董事会成员输入密钥以解锁";
                TBBoardKey.Visible             = true;
                TBResetAccount.Visible         = false;
                TBResetPassword.Visible        = false;
                TBResetPasswordConfirm.Visible = false;
            }
            else if (int.Parse(ViewState["SuccessTimes"].ToString()) == iBoardMemberAmount)
            {
                LBLSolution.Text               = "请立即重置管理员的信息";
                TBBoardKey.Visible             = false;
                TBResetAccount.Visible         = true;
                TBResetPassword.Visible        = true;
                TBResetPasswordConfirm.Visible = true;
            }
            LBLTest.Text = ViewState["SuccessTimes"].ToString();
        }
    }
    private void CounsellorInfoDisplayPage()
    {
        long lCounsellorID = long.Parse(Request.QueryString["CounsellorID"].ToString());
        CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类
        CounsellorInfoEntity   CounsellorInfoDetails  = new CounsellorInfoEntity();

        CounsellorInfoDetails = CounsellorInfoBusiness.GetCounsellorResumeInfoByID(lCounsellorID);

        IMGCounsellorImage.ImageUrl        = CounsellorInfoDetails.scounsellorImage;
        LBLCounsellorName.Text             = CounsellorInfoDetails.scounsellorName;
        LBLCounsellorSex.Text              = CounsellorInfoDetails.scounsellorSex;
        LBLCounsellorAge.Text              = CounsellorInfoDetails.icounsellorAge.ToString();
        LBLCounsellorEmail.Text            = CounsellorInfoDetails.scounsellorEmail;
        LBLCounsellorPhoneNumber.Text      = CounsellorInfoDetails.lcounsellorPhoneNumber.ToString();
        LBLCounsellorSelfIntroduction.Text = CounsellorInfoDetails.scounsellorSelfIntroduction;
        LBLCounsellorWallet.Text           = CounsellorInfoDetails.lcounsellorWallet.ToString();

        string[] saCounsellorAdvantageFields = new string[8];
        saCounsellorAdvantageFields = CounsellorInfoDetails.sacounsellorAdvantageField;

        StringBuilder CounsellorAdvantageFields = new StringBuilder();

        for (int iCounter = 0; iCounter < 8; iCounter++)
        {
            CounsellorAdvantageFields.Append(saCounsellorAdvantageFields[iCounter] + ",");
        }

        string sCounsellorAdvantageFields = CounsellorAdvantageFields.ToString();

        LBLCounsellorAdvantageFields.Text = sCounsellorAdvantageFields;

        long lBoardMemberSequenceID = long.Parse(Session["UsersID"].ToString());
        BoardInfoBusiness BoardInfo = new BoardInfoBusiness();

        int iJudgementValue = (int)BoardInfo.ApplySelectionJudgement(lBoardMemberSequenceID);

        if (iJudgementValue > 0)
        {
            LBLVote.Text      = "您已投票!";
            BTNAgree.Visible  = false;
            BTNRefuse.Visible = false;
        }
        else
        {
            LBLVote.Visible = false;
        }
        long lBoardApplyID;

        lBoardApplyID = BoardInfo.GetBoardApplyIDByCounsellorID(lCounsellorID);

        BoardInfoBusiness GetResultAmount = new BoardInfoBusiness();//显示投票数

        LBLAgreeCount.Text  = GetResultAmount.BoardApplyAgreeAmount(lBoardApplyID).ToString();
        LBLRefuseCount.Text = GetResultAmount.BoardApplyRefuseAmount(lBoardApplyID).ToString();
    }
    protected void BTNUpdate_Click(object sender, EventArgs e)
    {
        long lBoardSequenceID = long.Parse(Session["BoardMemberID"].ToString());
        BoardInfoBusiness BoardPasswordUpdate = new BoardInfoBusiness();
        int iReturnValue = (int)BoardPasswordUpdate.BoardMemberLoginPasswordUpdate(TBBoardPassword.Text, lBoardSequenceID);

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('成功修改密码!')</script>");
        }
        else
        {
            Response.Write("<script>alert('修改密码失败!')</script>");
        }
    }
    private void BoardMemberInfoDefaultDisplay()
    {
        LBLFounderCode.Visible = false;
        long lBoardSequenceID = long.Parse(Session["BoardMemberID"].ToString());

        //LBLBoardGreetings.Text=
        BoardInfoBusiness    BoardMemberPersonalInfoDisplay = new BoardInfoBusiness();
        CounsellorInfoEntity BoardMemberPersonalInfo        = new CounsellorInfoEntity();

        BoardMemberPersonalInfo = BoardMemberPersonalInfoDisplay.GetBoardPersonInfoByCounsellorID(lBoardSequenceID);
        LBLBoardMemberName.Text = BoardMemberPersonalInfo.scounsellorName;
        if (BoardMemberPersonalInfo.scounsellorSex == "男")
        {
            LBLBoardMemberSex.Text = "先生";
        }
        else if (BoardMemberPersonalInfo.scounsellorSex == "女")
        {
            LBLBoardMemberSex.Text = "女生";
        }
        else
        {
            LBLBoardMemberSex.Text = BoardMemberPersonalInfo.scounsellorSex;
        }

        BoardInfoBusiness BoardInfo = new BoardInfoBusiness();
        long lBoardID = BoardInfo.GetBoardMemberIDBySequence(lBoardSequenceID);

        BoardInfoEntity BoardMemberInfo = new BoardInfoEntity();

        BoardMemberInfo         = BoardInfo.GetBoardInfoBySequenceID(lBoardSequenceID);
        LBLBoardSecretKEY.Text  = BoardMemberInfo.boardSecretKey;
        LBLBoardSequenceID.Text = BoardMemberInfo.boadrMemberSequenceID.ToString();
        if (!IsPostBack)
        {
            TBBoardPassword.Text = BoardMemberInfo.boardMemberLoginPassword;
        }


        if (lBoardID % 100 != 67)
        {
            LBLFounderCode.Visible = true;
            LBLFounderCode.Text    = "欢迎您,创始人" + lBoardID.ToString();
        }
        else
        {
            LBLBoardSequenceID.Visible = false;
        }
    }
    protected void GVBoardMemberDischarge_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        long lBoardSequenceID            = long.Parse(Session["BoardMemberID"].ToString());
        long lBEENDischargeBoardMemberID = long.Parse(e.CommandArgument.ToString());
        BoardInfoBusiness BoardInfo      = new BoardInfoBusiness();
        int iReturnValue = int.Parse(BoardInfo.BoardMemberDischargeExistJudgement(lBoardSequenceID, lBEENDischargeBoardMemberID).ToString());

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('您已申请开除此成员!')</script>");
        }
        else
        {
            BoardInfo.BoardMemberDischarge(lBoardSequenceID, lBEENDischargeBoardMemberID);
        }
    }
    protected void BTNRefuse_Click(object sender, EventArgs e)
    {
        long lCounsellorID          = long.Parse(Request.QueryString["CounsellorID"].ToString());
        long lBoardMemberSequenceID = long.Parse(Session["UsersID"].ToString());
        long lBoardApplyID;
        BoardInfoBusiness BoardInfo = new BoardInfoBusiness();

        lBoardApplyID = BoardInfo.GetBoardApplyIDByCounsellorID(lCounsellorID);

        int iReturnValue = BoardInfo.BoardApplyDeny(lBoardApplyID, lBoardMemberSequenceID, 'N');

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('投票成功!')</script>");
        }
    }
    protected void BTNBoardAccessApply_Click(object sender, EventArgs e)
    {
        long   lCounsellorID    = long.Parse(Session["UsersID"].ToString());
        string sRandomSecretKEY = RandomString();

        BoardInfoBusiness BoardInfo = new BoardInfoBusiness();
        int iReturnValue            = BoardInfo.BoardApply(lCounsellorID, sRandomSecretKEY);

        if (iReturnValue > 0)
        {
            Response.Write("<script>alert('申请成功!请等待结果!')</script>");
        }
        else
        {
            Response.Write("<script>alert('申请失败!')</script>");
        }
    }
Exemplo n.º 11
0
    private void BoardLogin()
    {
        /**
         * 查询是否存在 董事会成员
         *
         */
        BoardInfoBusiness BoardLogin = new BoardInfoBusiness();
        int iJudgementValue          = (int)BoardLogin.BoardExistJudgement(long.Parse(TBAdministratorAccount.Text), TBAdministratorPassword.Text);

        if (iJudgementValue > 0)
        {
            Session["BoardMemberID"] = TBAdministratorAccount.Text;
            Response.Redirect("~/02BoardCentre.aspx");
        }
        else
        {
            Response.Redirect("~/0000.aspx");
        }
    }
    private void BoardKeyMethod(string sInputBoardKey, int iBoardMemberAmount)
    {
        BoardInfoBusiness BoardInfoBusiness = new BoardInfoBusiness();

        int iExistKeyCounter = 0;

        if ((int)BoardInfoBusiness.BoardKeyExistJudgement(sInputBoardKey) > 0)//输入的密钥存在
        {
            string[] sa = ViewState["KEYsStorageArray"].ToString().Split(new char[] { ',' });
            for (int iCounter = 0; iCounter < sa.Length; iCounter++)
            {
                if (sInputBoardKey == sa[iCounter])
                {
                    iExistKeyCounter++;
                }
            }
            if (iExistKeyCounter == 0)
            {
                ViewState["SuccessTimes"]     = (int)ViewState["SuccessTimes"] + 1;
                ViewState["KEYsStorageArray"] = ViewState["KEYsStorageArray"] + sInputBoardKey + ",";
            }
        }
    }
    private void CounsellorInfoDisplayPage()
    {
        string[] saDefaultCounsellorAdvantageFields = { "刑法·盗窃罪共犯问题", "刑法·贪污贿赂问题", "刑事诉讼法", "民法·合同问题", "民法·知识产权", "婚姻继承问题", "民法·侵权责任问题", "民法·抵押担保问题" };//默认全部擅长领域
        int      iCounsellorAge;
        long     lCounsellorID = long.Parse(Session["UsersID"].ToString());

        LBLBoardSequenceID.Visible = false;
        LBLBoardPassword.Visible   = false;


        CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类
        CounsellorInfoEntity   CounsellorInfoEntity   = new CounsellorInfoEntity();

        if (!IsPostBack)
        {
            CounsellorInfoEntity = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID);
            string[] saCounsellorAdvantageFields = new string[8];
            IMGCounsellorImageDisplay.ImageUrl = CounsellorInfoEntity.scounsellorImage;
            LBLCounsellorName.Text             = CounsellorInfoEntity.scounsellorName;
            LBLCounsellorID.Text      = CounsellorInfoEntity.lcounsellorID.ToString();
            TBCounsellorPassword.Text = CounsellorInfoEntity.scounsellorPassword.ToString();
            TBCounsellorName.Text     = CounsellorInfoEntity.scounsellorName;
            if (CounsellorInfoEntity.scounsellorSex == "男")
            {
                RBMale.Checked = true;
            }
            else
            {
                RBFemale.Checked = true;
            }
            for (iCounsellorAge = 18; iCounsellorAge < 126; iCounsellorAge++)
            {
                DDLCounsellorAge.Items.Add(iCounsellorAge.ToString());
            }
            DDLCounsellorAge.SelectedValue = CounsellorInfoEntity.icounsellorAge.ToString();
            TBCounsellorEmail.Text         = CounsellorInfoEntity.scounsellorEmail;
            TBCounsellorPhoneNumber.Text   = CounsellorInfoEntity.lcounsellorPhoneNumber.ToString();
            IMGCounsellorImage.ImageUrl    = CounsellorInfoEntity.scounsellorImage;
            LBLCounsellorWallet.Text       = CounsellorInfoEntity.lcounsellorWallet.ToString();
            LBLCounsellorLevel.Text        = CounsellorInfoEntity.icounsellorLevel.ToString();
            for (int iCounter = 0; iCounter < saCounsellorAdvantageFields.Length; iCounter++)
            {
                saCounsellorAdvantageFields[iCounter] = CounsellorInfoEntity.sacounsellorAdvantageField[iCounter];
            }
            CounsellorAdvantageFieldsBonding(saCounsellorAdvantageFields, saDefaultCounsellorAdvantageFields);

            QuestionInfoDisplay(CounsellorInfoEntity.icounsellorLevel);//第三页等级提升的相关信息


            BoardInfoBusiness BoardInfo        = new BoardInfoBusiness();
            int iCounsellorApplyExistJudgement = (int)BoardInfo.CounsellorApplyExistJudgement(lCounsellorID);
            int iBoardExistJudgement           = (int)BoardInfo.BoardExistJudgement(lCounsellorID);

            if (CounsellorInfoEntity.icounsellorLevel != 3)
            {
                LBLBoardAccessAlert.Text    = "请提升您的等级,以获取准入资格!";
                BTNBoardAccessApply.Visible = false;
            }
            else if (iBoardExistJudgement > 0)
            {
                BTNBoardAccessApply.Visible = false;

                LBLBoardAccessAlert.Text = "申请已通过!请借助如下信息以登录董事会";
                BoardInfoEntity BoardInfoEntity = new BoardInfoEntity();
                BoardInfoEntity            = BoardInfo.GetBoardInfoByCounsellorID(lCounsellorID);
                LBLBoardSequenceID.Visible = true;
                LBLBoardSequenceID.Text    = "您的董事会账号为:" + BoardInfoEntity.boadrMemberSequenceID.ToString();
                if (BoardInfoEntity.boardMemberLoginPassword == "password")
                {
                    LBLBoardPassword.Visible = true;
                    LBLBoardPassword.Text    = "初始密码为:" + BoardInfoEntity.boardMemberLoginPassword + ",请务必更改密码";
                }
            }
            else if (iCounsellorApplyExistJudgement > 0)
            {
                LBLBoardAccessAlert.Text    = "您已申请加入董事会,请耐心等待结果!!";
                BTNBoardAccessApply.Visible = false;
            }
            else
            {
                LBLBoardAccessAlert.Text = "您的能力通过审核!请点击下方按钮以申请加入董事会";
            }
        }

        //差评警告系统
        double dBlackListAlert;
        double dCounsellorArticleLikedAmount         = 0;
        double dCounsellorArticleDislikedAmount      = 0;
        double dCounsellorRespondLikedCountAmount    = 0;
        double dCounsellorRespondDislikedCountAmount = 0;

        if (CounsellorInfoBusiness.CounsellorArticleLikedAmount(lCounsellorID).ToString() == "" || CounsellorInfoBusiness.CounsellorArticleDislikedAmount(lCounsellorID).ToString() == "" || CounsellorInfoBusiness.CounsellorRespondLikedCountAmount(lCounsellorID).ToString() == "" || CounsellorInfoBusiness.CounsellorRespondDislikedCountAmount(lCounsellorID).ToString() == "")
        {
            LBLBlackListAlert.Visible = false;
        }
        else
        {
            dCounsellorArticleLikedAmount         = double.Parse(CounsellorInfoBusiness.CounsellorArticleLikedAmount(lCounsellorID).ToString());
            dCounsellorArticleDislikedAmount      = double.Parse(CounsellorInfoBusiness.CounsellorArticleDislikedAmount(lCounsellorID).ToString());
            dCounsellorRespondLikedCountAmount    = double.Parse(CounsellorInfoBusiness.CounsellorRespondLikedCountAmount(lCounsellorID).ToString());
            dCounsellorRespondDislikedCountAmount = double.Parse(CounsellorInfoBusiness.CounsellorRespondDislikedCountAmount(lCounsellorID).ToString());
            if (dCounsellorArticleDislikedAmount + dCounsellorRespondDislikedCountAmount > 500)
            {
                dBlackListAlert = (dCounsellorArticleLikedAmount + dCounsellorRespondLikedCountAmount) / (dCounsellorArticleDislikedAmount + dCounsellorRespondDislikedCountAmount);
                if (dBlackListAlert < 1)
                {
                    LBLBlackListAlert.Text = "警告!您的差评比过低!";
                }
                else
                {
                    LBLBlackListAlert.Visible = false;
                }
            }
            else
            {
                LBLBlackListAlert.Visible = false;
            }
        }
    }