private void WantedPromoterDefaultInfoDisplay() { long lWantedID = long.Parse(Request.QueryString["WantedID"].ToString());//接收Wantedlist传来的ID WantedInfoBusiness WantedQuestionDetailsInfoSearch = new WantedInfoBusiness(); WantedQuestionDetailsInfoEntity WantedQuestionInfo = new WantedQuestionDetailsInfoEntity(); long UsersID = long.Parse(Session["UsersID"].ToString()); TBWantedTitle.ReadOnly = true; TBWantedContent.ReadOnly = true; DDLWantedBounty.Enabled = false; TBReply.Visible = false; BTNReply.Visible = false; BTNWantedInfoUpdate.Visible = false; if (UsersID % 100 == 67) {//如果是律师登录 TBReply.Visible = true; BTNReply.Visible = true; } else if (UsersID % 100 == 99) { //附加:如果是当前问题的提问人,则可以修改悬赏的信息 long lPromoterID = WantedQuestionDetailsInfoSearch.GetWantedPromoterIDByWantedID(lWantedID); if (UsersID == lPromoterID) { TBWantedTitle.ReadOnly = false; TBWantedContent.ReadOnly = false; DDLWantedBounty.Enabled = true; BTNWantedInfoUpdate.Visible = true; } TBReply.Visible = false; BTNReply.Visible = false; } else { //游客登录 } if (!IsPostBack) { WantedQuestionInfo = WantedQuestionDetailsInfoSearch.WantedQuestionDetailsInfoByID(lWantedID); LBLClientName.Text = WantedQuestionInfo.sclientName; TBWantedContent.Text = WantedQuestionInfo.swantedContent; DDLWantedBounty.SelectedValue = (WantedQuestionInfo.lwantedBounty / 10000).ToString(); TBWantedTitle.Text = WantedQuestionInfo.swantedTitle; LBLWantedField.Text = WantedQuestionInfo.swantedField; for (long iWantedBounty = WantedQuestionInfo.lwantedBounty / 10000; iWantedBounty < 101; iWantedBounty += 5)//绑定1~x万元 { DDLWantedBounty.Items.Add(iWantedBounty.ToString()); } } }
public WantedQuestionDetailsInfoEntity WantedQuestionDetailsInfoByID(long lWanted)//展示悬赏信息方法 { string sSQLText = "select ClientName ,WantedTitle ,WantedBounty , WantedField , WantedContent from ClientInfo, WantedQuestionInfo where ClientID = WantedPromoterID and WantedID = '" + lWanted + "'"; DataTable dataTable = DAL.DataBaseAccess.GetDataSet(sSQLText); //得到多值 WantedQuestionDetailsInfoEntity WantedQuestionDetailsInfo = new WantedQuestionDetailsInfoEntity(); //实体化Entity层的WantedQuestionDetailsInfoEntity if (dataTable.Rows.Count > 0) { WantedQuestionDetailsInfo.sclientName = "" + dataTable.Rows[0][0]; WantedQuestionDetailsInfo.swantedTitle = "" + dataTable.Rows[0][1]; WantedQuestionDetailsInfo.lwantedBounty = long.Parse("" + dataTable.Rows[0][2]); WantedQuestionDetailsInfo.swantedField = "" + dataTable.Rows[0][3]; WantedQuestionDetailsInfo.swantedContent = "" + dataTable.Rows[0][4]; } return(WantedQuestionDetailsInfo); }
protected void DLWantedAnswerInfo_ItemCommand(object source, DataListCommandEventArgs e) { Button BTNSelectAsAnswer = (Button)e.Item.FindControl("BTNSelectAsAnswer"); Label LBLAnswerID = (Label)e.Item.FindControl("LBLAnswerID"); WantedInfoBusiness SetTargetAsAnswer = new WantedInfoBusiness(); int iReturnedValue = 0; if (e.CommandName == "BTNSelectAsAnswer") { //当客户登录时,若没有选定的答案,则点击后可设置最佳答案 iReturnedValue = SetTargetAsAnswer.SetAsAnswer(long.Parse(LBLAnswerID.Text)); if (iReturnedValue > 0) { long lWantedID = long.Parse(Request.QueryString["WantedID"].ToString()); CounsellorInfoBusiness CounsellorInfo = new CounsellorInfoBusiness(); ClientInfoBusiness ClientInfo = new ClientInfoBusiness(); long lCounsellorID = CounsellorInfo.GetCounsellorIDByAnswerID(long.Parse(LBLAnswerID.Text)); long lClientID = ClientInfo.GetClientIDByWantedID(lWantedID); WantedInfoBusiness WantedQuestionDetailsInfoSearch = new WantedInfoBusiness(); WantedQuestionDetailsInfoEntity WantedQuestionInfo = new WantedQuestionDetailsInfoEntity(); WantedQuestionInfo = WantedQuestionDetailsInfoSearch.WantedQuestionDetailsInfoByID(lWantedID); long lBountyMoney = WantedQuestionInfo.lwantedBounty; LBLWantedField.Text = lBountyMoney.ToString(); ClientInfo.ClientWantedBountyMoney(lBountyMoney, lClientID); CounsellorInfo.CounsellorWalletMoneyUpdate(lCounsellorID, lBountyMoney); Response.Write("<script>alert('成功设置为答案!')</script>"); } else { Response.Write("<script>alert('设置为答案失败!')</script>"); } } /** * 任何身份都可以点赞,包括游客 */ else if (e.CommandName == "BTNRespondLikedCount") { //点了点赞后,让点赞数+1 iReturnedValue = SetTargetAsAnswer.RespondLiked(long.Parse(LBLAnswerID.Text)); if (iReturnedValue > 0) { Response.Write("<script>alert('您赞了此答案!')</script>"); } else { Response.Write("<script>alert('点赞失败!!')</script>"); } } else if (e.CommandName == "BTNRespondDislikedCount") { //点了点踩后,让点踩数+1 iReturnedValue = SetTargetAsAnswer.RespondDisliked(long.Parse(LBLAnswerID.Text)); if (iReturnedValue > 0) { Response.Write("<script>alert('您踩了此答案!')</script>"); } else { Response.Write("<script>alert('点踩失败!')</script>"); } } }