private void CounsellorDetailInfoDisplay() { long lUsersID = long.Parse(Session["UsersID"].ToString()); if (lUsersID == 0 || lUsersID % 100 == 67) { BTNEstablishContract.Visible = false; } long lCounsellorID = long.Parse(Request.QueryString["CounsellorID"].ToString()); //long lCounsellorID = 2020110619480567;//测试用 CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类 CounsellorInfoEntity CounsellorInfoEntity = new CounsellorInfoEntity(); ContractInfoBusiness ContractInfo = new ContractInfoBusiness(); //最上面的信息 CounsellorInfoEntity = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID); LBLCounsellorName.Text = CounsellorInfoEntity.scounsellorName; LBLCounsellorLevel.Text = CounsellorInfoEntity.icounsellorLevel.ToString(); IMGCounsellorImage.ImageUrl = CounsellorInfoEntity.scounsellorImage.ToString(); LBLCounsellorTips.Text = CounsellorInfoEntity.scounsellorSelfIntroduction.ToString(); LBLCounsellorOfferMoney.Text = CounsellorInfoEntity.lcounsellorOfferMoney.ToString(); //第一页信息 LBLCounsellorNamePage1.Text = CounsellorInfoEntity.scounsellorName; LBLCounsellorSex.Text = CounsellorInfoEntity.scounsellorSex; LBLCounsellorContractAmount.Text = ((int)ContractInfo.CounsellorContractAmount(lCounsellorID)).ToString(); //第三页信息 for (int iCounter = 0; iCounter < CounsellorInfoEntity.sacounsellorAdvantageField.Length; iCounter++) { //循环给Label赋值 Label LBLCounsellorAdvantageFields = (Label)this.Master.FindControl("ContentPlaceHolder1").FindControl("LBLCounsellorAdvantageField" + iCounter); if (CounsellorInfoEntity.sacounsellorAdvantageField[iCounter] == "待定") { LBLCounsellorAdvantageFields.Visible = false; } else { LBLCounsellorAdvantageFields.Text = CounsellorInfoEntity.sacounsellorAdvantageField[iCounter]; } } //第四页的信息 LBLCounsellorPhoneNumber.Text = CounsellorInfoEntity.lcounsellorPhoneNumber.ToString(); }
protected void BTNEstablishContract_Click(object sender, EventArgs e) { long lClientID = long.Parse(Session["UsersID"].ToString()); ClientInfoBusiness GetClientWallet = new ClientInfoBusiness(); ClientInfoEntity ClientWallet = new ClientInfoEntity(); ClientWallet = GetClientWallet.GetClientInfoByID(lClientID); long lCounsellorID = long.Parse(Request.QueryString["CounsellorID"].ToString()); CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类 CounsellorInfoEntity CounsellorInfoEntity = new CounsellorInfoEntity(); CounsellorInfoEntity = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID); ContractInfoBusiness ContractEstablish = new ContractInfoBusiness(); int iCounsellorContractExistDetect = int.Parse(ContractEstablish.CounsellorContractExistDetect(lClientID).ToString()); if (iCounsellorContractExistDetect > 0) { Response.Write("<script>alert('您已经与该律师签约!')</script>"); } else { if (ClientWallet.lclientWallet >= CounsellorInfoEntity.lcounsellorOfferMoney) { int iContractJudegementValue = ContractEstablish.ContractEstablish(lCounsellorID, lClientID); int iClientJudegementValue = GetClientWallet.ClientWalletMoneyUpdate(CounsellorInfoEntity.lcounsellorOfferMoney, lClientID); int iCounsellorJudegementValue = CounsellorInfoBusiness.CounsellorWalletMoneyUpdate(lCounsellorID, CounsellorInfoEntity.lcounsellorOfferMoney); if (iContractJudegementValue > 0 && iClientJudegementValue > 0 && iCounsellorJudegementValue > 0) { Response.Write("<script>alert('您已经成功签约!')</script>"); } else { Response.Write("<script>alert('签约失败!')</script>"); } } else { Response.Write("<script>alert('您的余额不足以签约!')</script>"); } } }
private void ArticleInfoDisplay(long lArticleID) { //获得文章信息 ArticleInfoBusiness GetArticleInfoByArticleID = new ArticleInfoBusiness(); ArticleInfoEntity ArticleInfo = new ArticleInfoEntity(); ArticleInfo = GetArticleInfoByArticleID.GetArticleInfoByID(lArticleID); LBLArticleTitle.Text = ArticleInfo.sarticleTitle; LBLArticleReadCountNumber.Text = ArticleInfo.iarticleReadCount.ToString(); LBLArticleLikedCount.Text = ArticleInfo.iarticleLikedCount.ToString(); LBLArticleDislikedCount.Text = ArticleInfo.iarticleDislikedCount.ToString(); LBLArticleContent.Text = ArticleInfo.sarticleContent; //获得作者信息 CounsellorInfoBusiness GetArticleAutherInfo = new CounsellorInfoBusiness(); CounsellorInfoEntity ArticleAutherInfo = new CounsellorInfoEntity(); long lAuthorID = ArticleInfo.larticleAutherID; if (lAuthorID == 0L) { BTNArticleDisliked.Visible = false; LBLArticleDisliked.Visible = false; LBLArticleDislikedCount.Visible = false; IMGArticleAuthorImage.Visible = false; LBLAuthorName.Text = "管理员"; LBAutherInfoDetails.Visible = false; LBLAuthorTips.Text = "此文章由管理员发布"; } else { ArticleAutherInfo = GetArticleAutherInfo.GetCounsellorInfoByID(lAuthorID); LBLAuthorName.Text = ArticleAutherInfo.scounsellorName; IMGArticleAuthorImage.ImageUrl = ArticleAutherInfo.scounsellorImage; LBLAuthorTips.Text = ArticleAutherInfo.scounsellorSelfIntroduction; } }
private string QuestionFieldRandom() { //递归实现问题领域的随机选取 long lCounsellorID = long.Parse(Session["UsersID"].ToString()); CounsellorInfoBusiness CounsellorInfoBusiness = new CounsellorInfoBusiness();//实体化BLL层中的CounsellorInfoBusiness类 CounsellorInfoEntity CounsellorInfoEntity = new CounsellorInfoEntity(); CounsellorInfoEntity = CounsellorInfoBusiness.GetCounsellorInfoByID(lCounsellorID); string[] saCounsellorAdvantageFields = new string[8]; for (int iCounter = 0; iCounter < saCounsellorAdvantageFields.Length; iCounter++) { saCounsellorAdvantageFields[iCounter] = CounsellorInfoEntity.sacounsellorAdvantageField[iCounter]; }//将获取的擅长领域加入到本方法内的数组 Random RandomQuestionID = new Random(); int iIndex = RandomQuestionID.Next(saCounsellorAdvantageFields.Length); int iQuestionFieldExistCounter = 0; string sQuestionFieldRandom = saCounsellorAdvantageFields[iIndex].ToString(); string[] sQuestionFields = { "刑法·贪污贿赂问题", "刑事诉讼法", "民法·合同问题", "民法·知识产权", "婚姻继承问题", "民法·侵权责任问题", "民法·抵押担保问题", "刑法·盗窃罪共犯问题" }; for (int iCounter = 0; iCounter < 8; iCounter++) { if (sQuestionFieldRandom == sQuestionFields[iCounter]) { iQuestionFieldExistCounter++; } } if (iQuestionFieldExistCounter > 0) { return(sQuestionFieldRandom); } else { return(QuestionFieldRandom()); } }
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; } } }