/// <summary> /// 保存五步会赞 /// </summary> /// <param name="context"></param> /// <returns></returns> private string AddParnerPraiseNum(HttpContext context) { BLLJIMP.Model.ForwardingRecord forRecord = bllJuactivity.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName='五伴会赞'", this.currentUserInfo.UserID, context.Request["id"], bllUser.WebsiteOwner)); WBHPartnerInfo model = bllUser.Get <WBHPartnerInfo>(string.Format("AutoId={0}", context.Request["id"])); if (forRecord == null) { forRecord = new BLLJIMP.Model.ForwardingRecord() { FUserID = this.currentUserInfo.UserID, RUserID = model.AutoId.ToString(), RdateTime = DateTime.Now, WebsiteOwner = bll.WebsiteOwner, TypeName = "五伴会赞" }; bllUser.Add(forRecord); model.ParTnerStep++; if (bllUser.Update(model)) { resp.Status = 1; resp.ExInt = model.ParTnerStep; resp.ExStr = "1"; } else { resp.Status = -1; resp.Msg = "系统错误,请联系管理员"; } } else { int count = bllUser.Delete(forRecord); model.ParTnerStep = model.ParTnerStep - 1; if (bllUser.Update(model) && count > 0) { resp.Status = 1; resp.ExInt = model.ParTnerStep; resp.ExStr = "0"; } else { resp.Status = -1; } } return(Common.JSONHelper.ObjectToJson(resp)); }
/// <summary> /// 保存分享记录 /// </summary> /// <param name="context"></param> /// <returns></returns> private bool SavaForwardingRecord(string userId) { if (currentUserInfo != null) { BLLJIMP.Model.ForwardingRecord record = new BLLJIMP.Model.ForwardingRecord() { RUserID = this.currentUserInfo.UserID, RUserName = this.currentUserInfo.TrueName, RdateTime = DateTime.Now, FUserID = currentUserInfo.UserID, FuserName = currentUserInfo.TrueName, WebsiteOwner = bllUser.WebsiteOwner, TypeName = "分享" }; return(bllUser.Add(record)); } return(false); }
/// <summary> /// 获取导师详情 /// </summary> /// <param name="UserId"></param> private void GetTutor(string UserId) { tInfo = bllUser.Get <BLLJIMP.Model.TutorInfo>(string.Format(" AutoId='{0}'", UserId)); if (tInfo != null) { BLLJIMP.Model.UserInfo uInfo = bllUser.Get <BLLJIMP.Model.UserInfo>(string.Format("UserId='{0}'", tInfo.UserId)); IheadImg.Src = tInfo.TutorImg; txtExplain.Text = tInfo.TutorExplain; txtTrade.Text = GetTradeStr(tInfo.TradeStr); //行业标签 txtProfessiona.Text = GettxtProfessionaStr(tInfo.ProfessionalStr); //专业标签 IsFollowedString = bllUser.CheckFollow(bllUser.GetCurrentUserInfo().UserID, tInfo.UserId) ? "关注" : "已关注"; FansNum.InnerText = uInfo.FansCount.ToString(); FansNumInt = uInfo.FansCount; BLLJIMP.Model.ForwardingRecord frecord = bllUser.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName='导师赞'", DataLoadTool.GetCurrUserModel().UserID, tInfo.UserId, bllUser.WebsiteOwner)); if (frecord != null) { zan = true; } UserLevel = bllUserScore.GetUserLevelByTotalScore(uInfo.HistoryTotalScore); } }
protected void Page_Load(object sender, EventArgs e) { try { model = bll.GetJuActivity(int.Parse(Request["id"])); model.PV++; bll.Update(model); txtPraiseNum.Text = model.UpCount.ToString(); try { BLLJIMP.Model.ForwardingRecord frecord = bll.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName = '文章赞'", bll.GetCurrentUserInfo().UserID, int.Parse(Request["id"]), bll.WebsiteOwner)); if (frecord != null) { zan = true; } #region 加投票功能 if (model.ActivityDescription.Contains("$TOUPIAO@")) { int start = model.ActivityDescription.IndexOf("$TOUPIAO@"); int end = model.ActivityDescription.LastIndexOf("TOUPIAO$"); int length = end - start - 1; string Voteid = model.ActivityDescription.Substring(model.ActivityDescription.IndexOf("$TOUPIAO@") + 1, length).Replace("TOUPIAO@", null); string str = "$TOUPIAO@" + Voteid + "TOUPIAO$"; model.ActivityDescription = model.ActivityDescription.Replace(str, bll.GetTheVoteInfo(Voteid)); } #endregion } catch (Exception) { } } catch (Exception) { Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { try { bll = new BLLJIMP.BLL(); AutoId = Request["id"]; GetPartnerInfo(AutoId); try { BLLJIMP.Model.ForwardingRecord frecord = bll.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND websiteOwner='{2}' AND TypeName='五伴会赞'", bll.GetCurrentUserInfo().UserID, int.Parse(Request["id"]), bll.WebsiteOwner)); if (frecord != null) { zan = true; } } catch (Exception) { } } catch (Exception) { Response.End(); } }