protected ZentCloud.BLLJIMP.Model.UserInfo currUserInfo; //当前登陆的用户 public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Expires = 0; string result = "false"; this.currUserInfo = DataLoadTool.GetCurrUserModel(); try { string action = context.Request["Action"]; //利用反射找到未知的调用的方法 if (!string.IsNullOrEmpty(action)) { MethodInfo method = this.GetType().GetMethod(action, BindingFlags.NonPublic | BindingFlags.Instance); //找到方法BindingFlags.NonPublic指定搜索非公有方法 result = Convert.ToString(method.Invoke(this, new[] { context })); //调用方法 } else { resp.Status = 0; resp.Msg = "Action为空!"; result = Common.JSONHelper.ObjectToJson(resp); } } catch (Exception ex) { resp.Status = -1; resp.Msg = ex.Message; result = Common.JSONHelper.ObjectToJson(resp); } context.Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { currUser = DataLoadTool.GetCurrUserModel(); cateRootId = Convert.ToInt32(Request["cateRootId"]); isNoPreSelect = Convert.ToInt32(Request["isNoPreSelect"]); selectMaxDepth = Convert.ToInt32(Request["selectMaxDepth"]); if (selectMaxDepth.Equals(0)) { selectMaxDepth = int.MaxValue; } isHide = bllMenupermission.CheckPerRelationByaccount(bllUser.GetCurrUserID(), -1); //是否传入了名称 var inputShowName = Request["currShowName"]; hasKeyValue = Request["hasKeyValue"]; if (!string.IsNullOrWhiteSpace(inputShowName)) { currShowName = inputShowName; nCategoryTypeConfig = new ArticleCategoryTypeConfig(); return; } //检查配置取名称 CategoryType = Request["type"]; nCategoryTypeConfig = bllArticleCategory.GetArticleCategoryTypeConfig(bllArticleCategory.WebsiteOwner, CategoryType); if (nCategoryTypeConfig != null) { currShowName = nCategoryTypeConfig.CategoryTypeExDispalyName; } else { currShowName = "分类"; nCategoryTypeConfig = new ArticleCategoryTypeConfig(); } }
protected void Page_Load(object sender, EventArgs e) { string activityID = Request["ActivityID"]; this.ViewState["ActivityID"] = activityID; activityInfo = new BLLActivity("").Get <ActivityInfo>(string.Format(" ActivityID = '{0}'", activityID)); if (activityInfo == null) { Response.Write("<script>alert('活动不存在!')</script>"); Response.End(); return; } var userInfo = DataLoadTool.GetCurrUserModel(); if (userInfo.UserType != 1)//普通用户 { if (activityInfo.WebsiteOwner != userInfo.WebsiteOwner) { //Response.Redirect("/FShare/ActivityManage.aspx"); Response.Write("<script>alert('无权访问该数据,请确认当前用户是否拥有该活动权限!')</script>"); Response.End(); return; } } //this.lbActivityName.Text = activityInfo.ActivityName; //Pms_JuActivity_Advanced = DataLoadTool.CheckCurrUserPms(PermissionKey.Pms_JuActivity_Advanced); }
protected void Page_Load(object sender, EventArgs e) { if (DataLoadTool.GetCurrUserModel().UserType == 1) { IsManager = true; } }
/// <summary> /// 根据条件获取数据 /// </summary> private static string GetAllByAny(HttpContext context) { //if (!_isview) //{ // return null; //} int pageIndex = Convert.ToInt32(context.Request["page"]); int pageSize = Convert.ToInt32(context.Request["rows"]); string keyWord = context.Request["SearchTitle"]; var strWhere = ""; var userinfo = DataLoadTool.GetCurrUserModel(); if (userinfo.UserType != 1) { strWhere = string.Format("UserID='{0}'", userinfo.UserID); } if (!string.IsNullOrEmpty(keyWord)) { strWhere += " UserID like '%" + keyWord + "%'"; } List <ZentCloud.BLLJIMP.Model.WeixinMsgDetails> list = bll.GetLit <ZentCloud.BLLJIMP.Model.WeixinMsgDetails>(pageSize, pageIndex, strWhere, "ReplyDate DESC"); int totalCount = bll.GetCount <ZentCloud.BLLJIMP.Model.WeixinMsgDetails>(strWhere); return(Common.JSONHelper.ObjectToJson( new { total = totalCount, rows = list })); }
protected void Page_Load(object sender, EventArgs e) { userModel = DataLoadTool.GetCurrUserModel(); juBll = new BLLJIMP.BLLJuActivity(); //获取活动ID int jid = Convert.ToInt32(Request["jid"], 16);//由16进制转换 pubjid = Request["jid"]; juActivityModel = juBll.GetJuActivity(jid); //判断权限 if (this.userModel.UserType != 1) { if (juActivityModel.UserID != this.userModel.UserID) { Response.Write("<script>alert('无权访问该贺卡!');</script>"); Response.End(); return; } } try { //获取活动报名数据 signUpDataList = this.juBll.QueryJuActivitySignUpData(jid); } catch { } if (signUpDataList == null) { signUpDataList = new List <BLLJIMP.Model.ActivityDataInfo>(); } }
protected void Page_Load(object sender, EventArgs e) { uinfo = DataLoadTool.GetCurrUserModel(); // txtScore.Text = uinfo.TotalScore.ToString(); bllUserScore = new BLLJIMP.BLLUserScore(uinfo.UserID); UserLevel = bllUserScore.GetUserLevelByTotalScore(uinfo.HistoryTotalScore); }
protected void Page_Load(object sender, EventArgs e) { if (bllMall.IsLogin) { UserInfo userInfo = DataLoadTool.GetCurrUserModel(); QCode.Append(string.Format("编号:{0}", userInfo.AutoID)); QCode.AppendFormat("姓名:{0}", userInfo.TrueName); QCode.AppendFormat("性别:"); if (!string.IsNullOrEmpty(userInfo.Gender)) { if (userInfo.Gender.Equals("1")) { QCode.Append("男"); } if (userInfo.Gender.Equals("0")) { QCode.Append("女"); } } QCode.AppendFormat("电话:{0}", userInfo.Phone); QCode.AppendFormat("Email:{0}", userInfo.Email); QCode.AppendFormat("地区:{0}", userInfo.AddressArea); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath)); } }
protected void Page_Load(object sender, EventArgs e) { currUserInfo = DataLoadTool.GetCurrUserModel(); currWebSiteModel = DataLoadTool.GetWebsiteInfoModel(); currWebSiteOwnerModel = new BLLJIMP.BLLUser("").GetUserInfo(currWebSiteModel.WebsiteOwner); signUpLoginName = Common.Base64Change.EncodeBase64ByUTF8(currWebSiteOwnerModel.UserID); signUploginPwd = Common.DEncrypt.ZCEncrypt(currWebSiteOwnerModel.Password); GetPageActionType(); }
protected override void OnInit(EventArgs e) { BLLJIMP.Model.UserInfo uinfo = DataLoadTool.GetCurrUserModel(); if (string.IsNullOrEmpty(uinfo.TrueName) && string.IsNullOrEmpty(uinfo.Phone) && string.IsNullOrEmpty(uinfo.Email)) { Response.Redirect("/WuBuHui/Member/Registration.aspx?from=" + Request.RawUrl); } base.OnInit(e); }
protected void Page_Load(object sender, EventArgs e) { if (bllMall.IsLogin) { currentUserInfo = DataLoadTool.GetCurrUserModel(); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Uid = Request["UserId"]; Url = Request["from"]; uinfo = DataLoadTool.GetCurrUserModel(); if (!string.IsNullOrEmpty(uinfo.TrueName) && !string.IsNullOrEmpty(uinfo.Phone) && !string.IsNullOrEmpty(uinfo.Email) && !string.IsNullOrEmpty(uinfo.Company)) { Response.Redirect("/WuBuHui/MyCenter/MyCenter.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { try { UserInfo = DataLoadTool.GetCurrUserModel(); VoteInfo = bllVote.GetVoteInfo(int.Parse(Request["vid"])); CanUseVoteCount = bllVote.GetCanUseVoteCount(VoteInfo.AutoID, DataLoadTool.GetCurrUserID()); RechargeList = bllVote.GetVoteRechargeList(VoteInfo.AutoID); } catch (Exception) { Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { UserInfo userInfo = DataLoadTool.GetCurrUserModel(); System.Text.StringBuilder sbWhere = new System.Text.StringBuilder(string.Format("WebsiteOwner='{0}'", bllVote.WebsiteOwner)); if ((!userInfo.UserID.Equals(bllVote.WebsiteOwner)) && (!userInfo.UserType.Equals(1))) { sbWhere.AppendFormat(" And CreateUserID='{0}'", userInfo.UserID); } foreach (var item in bllVote.GetLit <VoteInfo>(100, 1, sbWhere.ToString(), "AutoID DESC")) { sbVoteList.AppendLine(string.Format("<option value=\"{0}\">{1}</option>", item.AutoID, item.VoteName)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { uinfo = DataLoadTool.GetCurrUserModel(); bllUserScore = new BLLJIMP.BLLUserScore(uinfo.UserID); BLLJIMP.BLL bll = new BLLJIMP.BLL(); txtCount.Text = bll.GetCount <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' and TypeName = '分享'", uinfo.UserID)).ToString(); IsShowRed = bll.GetCount <BLLJIMP.Model.ReviewInfo>(string.Format("ForeignkeyId='{0}' and IsRead <> 1", uinfo.UserID)) > 0 ? true : false; UserLevel = bllUserScore.GetUserLevelByTotalScore(uinfo.HistoryTotalScore); FlowerCount = bllUser.GetUserFlowerCount(uinfo.UserID); AttentionCount = bllUser.GetUserAttentionCount(uinfo.UserID); IsHaveUnReadMessage = bllNotice.IsHaveUnReadMessage(bll.GetCurrentUserInfo().UserID).ToString(); IsTutor = bllUser.IsTutor(uinfo); } }
protected void Page_Load(object sender, EventArgs e) { UserInfo userModel = DataLoadTool.GetCurrUserModel(); if (userModel != null) { if (!string.IsNullOrEmpty(userModel.TrueName)) { WxNickName = userModel.TrueName; } else if (!string.IsNullOrEmpty(userModel.WXNickname)) { WxNickName = userModel.WXNickname; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { BLLJIMP.Model.UserInfo CurrentUserInfo = DataLoadTool.GetCurrUserModel(); int id = Convert.ToInt32(Request["id"]); Convert.ToString(id, 16); Response.Redirect(string.Format("http://{0}/{1}/{2}/details.chtml", this.Request.Url.Host + ":" + this.Request.Url.Port, Convert.ToString(id, 16), Convert.ToString(CurrentUserInfo.AutoID, 16))); } catch (Exception) { throw; } } }
private void GetCType() { this.websiteOwner = DataLoadTool.GetWebsiteInfoModel().WebsiteOwner; this.uinfo = DataLoadTool.GetCurrUserModel(); List <BLLJIMP.Model.ArticleCategory> acategorys = bll.GetList <BLLJIMP.Model.ArticleCategory>(string.Format(" CategoryType='word'AND WebsiteOwner='{0}'", this.websiteOwner)); if (acategorys != null) { foreach (BLLJIMP.Model.ArticleCategory item in acategorys) { DisussStr += "<li class=\"catli\" v=\"" + item.AutoID + "\"><a >" + item.CategoryName + "</a></li>"; } } //设置用户所有话题为已读 BLLJIMP.BLL.ExecuteSql(string.Format("update ZCJ_ReviewInfo set IsRead = 1 where ForeignkeyId='{0}' and IsRead <> 1 and websiteowner='{1}'", uinfo.UserID, websiteOwner)); }
protected void Page_Load(object sender, EventArgs e) { if (bll.IsLogin) { currentUserInfo = DataLoadTool.GetCurrUserModel(); currentWebSiteInfo = bll.GetWebsiteInfoModel(); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath)); } foreach (var item in bll.GetDeliveryList()) { sbDelivery.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoId, item.DeliveryName); } foreach (var item in bll.GetPaymentTypeList()) { sbPaymentType.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoId, item.PaymentTypeName); } }
protected void Page_Load(object sender, EventArgs e) { if (bllMall.IsLogin) { userInfo = DataLoadTool.GetCurrUserModel(); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath)); } currWebSiteInfo = bllMall.GetWebsiteInfoModel(); if (currWebSiteInfo.MallTemplateId.Equals(1))//外卖 { WXMallIndexUrl = "Indexv2.aspx"; } websiteInfo = DataLoadTool.GetWebsiteInfoModel(); if (string.IsNullOrEmpty(websiteInfo.MallType)) { websiteInfo.MallType = "0"; } }
protected void Page_Load(object sender, EventArgs e) { if (bllMall.IsLogin) { UserInfo userInfo = DataLoadTool.GetCurrUserModel(); string orderid = Request["oid"]; if (string.IsNullOrEmpty(orderid)) { Response.End(); } WXMallOrderInfo orderInfo = bllMall.GetOrderInfo(orderid); if (orderInfo == null) { Response.End(); } if (!orderInfo.OrderUserID.Equals(userInfo.UserID)) { Response.End(); } QCode.Append(string.Format("订单编号:{0}; ", orderInfo.OrderID)); //QCode.AppendFormat("商品数量:{0}", orderInfo.ProductCount); //QCode.AppendFormat("总金额:{0}", orderInfo.TotalAmount); //QCode.AppendFormat("收货人:{0}", orderInfo.Consignee); //QCode.AppendFormat("手机号:{0}", orderInfo.Phone); //QCode.AppendFormat("手机号:{0}", orderInfo.Phone); List <WXMallOrderDetailsInfo> orderdetails = bllMall.GetOrderDetailsList(orderid); foreach (var item in orderdetails) { WXMallProductInfo productInfo = bllMall.GetProduct(item.PID); if (productInfo != null) { QCode.AppendFormat("[{0} X {1}];", productInfo.PName, item.TotalCount); } } } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.Url.PathAndQuery)); } }
protected void Page_Load(object sender, EventArgs e) { uinfo = DataLoadTool.GetCurrUserModel(); bllUserScore = new BLLJIMP.BLLUserScore(uinfo.UserID); UserLevel = bllUserScore.GetUserLevelByTotalScore(uinfo.HistoryTotalScore); NextUserLevel = bllUserScore.Get <UserLevelConfig>(string.Format("LevelNumber={0}", UserLevel + 1)); if (NextUserLevel == null) { NextUserLevel = new UserLevelConfig(); NextUserLevel.LevelNumber = 1; NextUserLevel.FromHistoryScore = 0; } Percent = (int)((uinfo.HistoryTotalScore / NextUserLevel.FromHistoryScore) * 100); if (Percent < 0) { Percent = 0; } if (Percent > 100) { Percent = 100; } }
protected void Page_Load(object sender, EventArgs e) { try { int Pid = int.Parse(Request["pid"]); model = bllMall.GetScoreProduct(Pid); if (model == null) { Response.End(); } if (bllMall.IsLogin) { currentUserInfo = DataLoadTool.GetCurrUserModel(); } else { Response.Redirect(string.Format("/App/Cation/Wap/Login.aspx?redirecturl={0}", Request.FilePath + "?pid=" + Request["pid"])); } } catch (Exception) { Response.End(); } }
/// <summary> /// 获取篇文章内容 /// </summary> /// <param name="context"></param> /// <returns></returns> private string GetSingleArticle(HttpContext context) { var source = bllJuactivity.GetJuActivity(Convert.ToInt32(context.Request["articleid"], 16)); string host = string.Format("http://{0}", context.Request.Url.Authority); ArticleModel model = new ArticleModel(); model.ArticleTitle = source.ActivityName; model.ArticleContent = source.ActivityDescription; #region 报名表单 try { //加载报名表单 if ((!string.IsNullOrEmpty(source.SignUpActivityID)) && (int.Parse(source.SignUpActivityID) > 0)) { //当前登录信息 ZentCloud.BLLJIMP.Model.UserInfo currUserInfo = new BLLJIMP.Model.UserInfo(); if (bll.IsLogin) { currUserInfo = DataLoadTool.GetCurrUserModel(); } System.Text.StringBuilder sbAppend = new System.Text.StringBuilder(); sbAppend.AppendLine("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/buttons.css\"/>"); sbAppend.AppendLine(" <style type=\"text/css\">input[type='text'],textarea{height:30px;width:100%;border-radius: 2px;margin-top:5px;}</style>"); sbAppend.AppendLine("<script src=\"/Scripts/jquery.form.js\" type=\"text/javascript\"></script>"); sbAppend.AppendLine("<form id=\"formsignin\">"); var mapList = bllActivity.GetActivityFieldMappingList(source.SignUpActivityID); foreach (var item in mapList) { if (item.FieldName.Equals("Name")) { sbAppend.AppendLine(string.Format("<input placeholder=\"姓名\" name=\"Name\" id=\"txtName\" type=\"text\" value=\"{0}\">", currUserInfo.TrueName)); } else if (item.FieldName.Equals("Phone")) { sbAppend.AppendLine(string.Format("<input placeholder=\"手机\" name=\"Phone\" id=\"txtPhone\" type=\"text\" value=\"{0}\">", currUserInfo.Phone)); } else { if (item.IsMultiline.Equals(1)) { sbAppend.AppendLine(string.Format("<textarea placeholder=\"{0}\" name=\"{1}\" style=\"height:50px;\" ></textarea>", item.MappingName, "K" + item.ExFieldIndex.ToString())); } else { if (item.MappingName.Contains("公司")) { sbAppend.AppendLine(string.Format("<input placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Company)); } else if (item.MappingName.Contains("职位") || item.MappingName.Contains("职务")) { sbAppend.AppendLine(string.Format("<input placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Postion)); } else if (item.MappingName.Contains("邮箱") || item.MappingName.Contains("邮件") || item.MappingName.ToLower().Contains("email")) { sbAppend.AppendLine(string.Format("<input placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Email)); } else { sbAppend.AppendLine(string.Format("<input placeholder=\"{0}\" name=\"{1}\" type=\"text\">", item.MappingName, "K" + item.ExFieldIndex.ToString())); } } } } sbAppend.AppendLine("<span class=\"button button-rounded button-flat-action\" style=\"width:86%;margin-top:10px;\" onclick=\"SumitData()\" >提交</span>"); sbAppend.AppendLine(string.Format("<input type=\"hidden\" value=\"{0}\" name=\"ActivityID\">", source.SignUpActivityID)); BLLJIMP.Model.UserInfo userInfo = bll.Get <BLLJIMP.Model.UserInfo>(string.Format(" UserId='{0}'", source.UserID)); sbAppend.AppendLine(string.Format("<input id=\"loginName\" type=\"hidden\" value=\"{0}\" name=\"LoginName\" />", ZentCloud.Common.Base64Change.EncodeBase64ByUTF8(userInfo.UserID))); //外部登录名 sbAppend.AppendLine(string.Format("<input id=\"loginPwd\" type=\"hidden\" value=\"{0}\" name=\"LoginPwd\" />", ZentCloud.Common.DEncrypt.ZCEncrypt(userInfo.Password))); //外部登录密码 sbAppend.AppendLine("</form>"); // sbAppend.AppendLine("<script type=\"text/javascript\">"); sbAppend.AppendLine("function SumitData() {"); sbAppend.AppendLine("var Name = $(\"#txtName\").val();"); sbAppend.AppendLine("var Phone = $(\"#txtPhone\").val();"); sbAppend.AppendLine("if (Name == \"\" || (Phone == \"\")) {alert(\"请输入姓名、手机号码\");return false; }"); sbAppend.AppendLine("$(\"#formsignin\").ajaxSubmit({"); sbAppend.AppendLine("url: \"/serv/ActivityApiJson.ashx\","); sbAppend.AppendLine("type: \"post\","); sbAppend.AppendLine("dataType: \"json\","); sbAppend.AppendLine("success: function (resp) {"); sbAppend.AppendLine("if (resp.Status == 0) {//清空"); sbAppend.AppendLine(" $('input:text').val(\"\");"); sbAppend.AppendLine("$('textarea').val(\"\");"); sbAppend.AppendLine("alert(\"提交成功!\");"); sbAppend.AppendLine("return;"); sbAppend.AppendLine("}"); sbAppend.AppendLine("else if (resp.Status == 1) {alert(\"重复提交!\");}"); sbAppend.AppendLine(" else {alert(resp.Msg);}"); sbAppend.AppendLine("}});return false; };"); sbAppend.AppendLine("</script>"); model.ArticleContent += sbAppend.ToString(); } } catch (Exception) { } //加载报名表单 #endregion model.ArticleThumbnails = bll.GetImgUrl(source.ThumbnailsPath); //model.ArticleUrl = string.Format("{0}/{1}/details.chtml", host, source.JuActivityIDHex); return(Common.JSONHelper.ObjectToJson(model)); }
/// <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) { uinfo = DataLoadTool.GetCurrUserModel(); }
protected void Page_Load(object sender, EventArgs e) { try { #region 检查订单是否可以支付 int recordId = int.Parse(Request["recordid"]); CrowdFundRecord model = bllBase.Get <CrowdFundRecord>(string.Format(" RecordID={0}", recordId)); if (model == null) { Response.Write("订单无效"); Response.End(); } if (model.Status.Equals(1)) { Response.Write("订单已经付款"); Response.End(); } #endregion #region 获取预支付ID PayConfig payConfig = bllPay.GetPayConfig(); var nonStr = Payment.WeiXin.CommonUtil.CreateNoncestr();//随机串 // Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("appid", payConfig.WXAppId); dic.Add("body", "订单号" + model.RecordID); dic.Add("mch_id", payConfig.WXMCH_ID); dic.Add("nonce_str", nonStr); dic.Add("out_trade_no", model.RecordID.ToString()); dic.Add("openid", DataLoadTool.GetCurrUserModel().WXOpenId); dic.Add("spbill_create_ip", Request.UserHostAddress); dic.Add("total_fee", (model.Amount * 100).ToString("F0")); dic.Add("notify_url", string.Format("http://{0}/WxPayNotify/NotifyCrowdFund.aspx", Request.Url.Host)); dic.Add("trade_type", "JSAPI"); string strtemp = Payment.WeiXin.CommonUtil.FormatBizQueryParaMap(dic, false); string sign = MD5SignUtil.Sign(strtemp, payConfig.WXPartnerKey); dic = (from entry in dic orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); dic.Add("sign", sign); string postData = Payment.WeiXin.CommonUtil.ArrayToXml(dic); string url = "https://api.mch.weixin.qq.com/pay/unifiedorder"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); byte[] requestBytes = System.Text.Encoding.UTF8.GetBytes(postData); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = requestBytes.Length; Stream requestStream = req.GetRequestStream(); requestStream.Write(requestBytes, 0, requestBytes.Length); requestStream.Close(); HttpWebResponse res = (HttpWebResponse)req.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream(), System.Text.Encoding.UTF8); string backStr = sr.ReadToEnd(); sr.Close(); res.Close(); var result = XDocument.Parse(backStr); var returnCode = result.Element("xml").Element("return_code").Value; var prepayId = ""; var rusultCode = result.Element("xml").Element("result_code").Value; if (returnCode.ToUpper().Equals("SUCCESS") && (rusultCode.ToUpper().Equals("SUCCESS"))) { prepayId = result.Element("xml").Element("prepay_id").Value; } #endregion #region 生成支付请求 WXPayReq reqwx = new WXPayReq(); string timeStamp = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString(); reqwx.appId = payConfig.WXAppId; reqwx.nonceStr = nonStr; reqwx.package = "prepay_id=" + prepayId; reqwx.signType = "MD5"; reqwx.timeStamp = timeStamp; Dictionary <string, string> dicNew = new Dictionary <string, string>(); dicNew.Add("appId", reqwx.appId); dicNew.Add("timeStamp", reqwx.timeStamp); dicNew.Add("nonceStr", reqwx.nonceStr); dicNew.Add("package", reqwx.package); dicNew.Add("signType", "MD5"); string strTemp1 = Payment.WeiXin.CommonUtil.FormatQueryParaMap(dicNew); string paySign = MD5SignUtil.Sign(strTemp1, payConfig.WXPartnerKey); reqwx.paySign = paySign; WxPayReq = ZentCloud.Common.JSONHelper.ObjectToJson(reqwx); #endregion // } catch (Exception ex) { Response.Write(ex.Message); Response.End(); } }
/// <summary> /// 返回投票内容 /// </summary> /// <param name="tvInfo"></param> /// <returns></returns> private string ToHtml(BLLJIMP.Model.TheVoteInfo tvInfo) { StringBuilder htmlStr = new StringBuilder(); string classStr = ""; string selectStr = ""; string str = ""; BLLJIMP.Model.UserVoteInfo uvInfo = null; if (bll.IsLogin) { this.userInfo = DataLoadTool.GetCurrUserModel(); string whereStr = string.Format(" UserId='{0}' and VoteId='{1}'", userInfo.UserID, tvInfo.AutoId); uvInfo = bll.Get <BLLJIMP.Model.UserVoteInfo>(whereStr); } //uvInfo = null; if (uvInfo != null) { classStr = "toupiaobox toupiaoover"; } else { if (tvInfo.VoteSelect == "1") { classStr = "toupiaobox"; selectStr = "radio"; str = "以下选项为单选"; } else if (tvInfo.VoteSelect == "2") { classStr = "toupiaobox duoxuan"; selectStr = "checkbox"; str = "以下选项为多选"; } } htmlStr.AppendFormat("<link rel=\"stylesheet\" href=\"styles/css/style.css?v=0.0.1\">"); htmlStr.AppendFormat("<div id=\"toupiao\" class=\"{0}\">", classStr); htmlStr.AppendFormat("<div><img src=\"{0}\"></div>", tvInfo.ThumbnailsPath); htmlStr.AppendFormat("<div class=\"title\">{0}</div>", tvInfo.VoteName); htmlStr.AppendFormat("<p class=\"note\">{0}</p>", str); htmlStr.AppendFormat("<input type=\"hidden\" id=\"SelectStr\" value=\"{0}\" />", selectStr); htmlStr.AppendFormat("<input type=\"hidden\" id=\"AutoId\" value=\"{0}\" />", tvInfo.AutoId); List <BLLJIMP.Model.DictionaryInfo> dInfos = bll.GetList <BLLJIMP.Model.DictionaryInfo>(" ForeignKey='" + tvInfo.AutoId + "'"); foreach (var item in dInfos) { htmlStr.AppendFormat("<input name=\"radiocheck2\" type=\"{0}\" class=\"radioinput\" id=\"{1}\" value=\"\" v=\"{2}\">", selectStr, selectStr + item.AutoID, item.AutoID); htmlStr.AppendFormat("<div class=\"mainconcent\">"); htmlStr.AppendFormat("<label class=\"inputlabel\" for=\"{0}\"></label>", selectStr + item.AutoID); htmlStr.AppendFormat("<span class=\"inputicon\"><span class=\"icon\"></span></span>"); htmlStr.AppendFormat("<div class=\"inputtext\" >{0}</div>", item.ValueStr); htmlStr.AppendFormat("<div class=\"jindubar\">"); double f = 0; if (tvInfo.VoteNumbers != 0) { f = Math.Round((Convert.ToDouble(item.VoteNums) / Convert.ToDouble(tvInfo.VoteNumbers)) * 100, 0); } htmlStr.AppendFormat("<span class=\"jindu\" style=\"width:{0}%;\"></span>", f); htmlStr.AppendFormat("<span class=\"peoplenum\">{0}票数</span>", item.VoteNums); htmlStr.AppendFormat("<span class=\"pecent\">{0}%</span>", f); htmlStr.AppendFormat("</div></div>"); } string dName = ""; if (uvInfo != null) { dInfos = bll.GetList <BLLJIMP.Model.DictionaryInfo>(" AutoId in (" + uvInfo.DiInfoId + ")"); if (dInfos != null) { foreach (BLLJIMP.Model.DictionaryInfo item in dInfos) { dName += item.ValueStr + " "; } } } htmlStr.AppendFormat("<span class=\"button\" id=\"btnSave\" onclick=\"SaveInfo()\">投票</span>"); htmlStr.AppendFormat("<span class=\"toupiaoinfo\" >你已投过票,投票项为\"{0}\"</span>", dName); htmlStr.AppendFormat("</div>"); return(htmlStr.ToString()); }
protected void Page_Load(object sender, EventArgs e) { articleId = Request["articleId"]; if (articleId == null) { Response.End(); } int articleIdint; if (!int.TryParse(articleId, out articleIdint)) { Response.End(); } currentUserInfo = DataLoadTool.GetCurrUserModel(); currWebSiteUserInfo = bll.Get <UserInfo>(string.Format("UserID='{0}'", DataLoadTool.GetWebsiteInfoModel().WebsiteOwner));// JuActivityInfo articleInfo = bll.Get <JuActivityInfo>(string.Format("JuActivityID={0}", articleIdint)); if (articleInfo == null) { Response.End(); } if (!currentUserInfo.UserType.Equals(1)) { if (!articleInfo.WebsiteOwner.Equals(currentUserInfo.WebsiteOwner)) { Response.End(); } } var articleIdHex = Convert.ToString(articleIdint, 16); //文章活动ID十六进制 string pageUrl = string.Format("http://{0}/{1}/details.chtml", Request.Url.Host, articleIdHex); var rootList = bll.GetList <WebAccessLogsInfo>(string.Format("(Ex_PreSpreadUserID is null or Ex_PreSpreadUserID='') And (Ex_PreShareTimestamp is null or Ex_PreShareTimestamp='') And Ex_SpreadUserID !='' And Ex_SpreadUserID is not null And Ex_ShareTimestamp !='' And Ex_ShareTimestamp is not null And PageUrl like '{0}%' Order by AccessDate ASC", pageUrl)); //根节点 if (rootList.Count > 0) { rootList = rootList.DistinctBy(p => p.Ex_ShareTimestamp).ToList(); System.Text.StringBuilder sbRoot = new System.Text.StringBuilder(); for (int i = 0; i < rootList.Count; i++) { var item = rootList[i]; //int count = bll.GetCount<WebAccessLogsInfo>(string.Format("Ex_PreSpreadUserID='{0}' And Ex_PreShareTimestamp='{1}' Order by AccessDate ASC", item.Ex_SpreadUserID, item.Ex_ShareTimestamp)); var subList = bll.GetList <WebAccessLogsInfo>(string.Format("Ex_PreSpreadUserID='{0}' And Ex_PreShareTimestamp='{1}' Order by AccessDate ASC ", item.Ex_SpreadUserID, item.Ex_ShareTimestamp)); subList = subList.DistinctBy(p => p.Ex_ShareTimestamp).ToList(); int count = subList.Count; var isParent = false; if (count > 0) { isParent = true; } string wxNickName = "无昵称"; string wxHeadImg = "/zTree/css/zTreeStyle/img/diy/user.png"; string icon = "/zTree/css/zTreeStyle/img/diy/user.png"; var userInfo = bll.Get <UserInfo>(string.Format("UserID='{0}'", item.Ex_SpreadUserID)); if (userInfo != null) { if (!string.IsNullOrEmpty(userInfo.WXNickname)) { wxNickName = userInfo.WXNickname; } if (!string.IsNullOrEmpty(userInfo.WXHeadimgurlLocal)) { wxHeadImg = userInfo.WXHeadimgurlLocal; } else { if (!string.IsNullOrEmpty(userInfo.WXOpenId)) { //拉取用户信息并更新数据库 ZentCloud.BLLJIMP.Model.Weixin.WeixinUserInfo weixinInfo = bllWeixin.GetWeixinUserInfo(currWebSiteUserInfo.UserID, currWebSiteUserInfo.WeixinAppId, currWebSiteUserInfo.WeixinAppSecret, userInfo.WXOpenId); if (weixinInfo != null) { if (!string.IsNullOrEmpty(weixinInfo.NickName)) { userInfo.WXNickname = weixinInfo.NickName; } if (!string.IsNullOrEmpty(weixinInfo.HeadImgUrl)) { userInfo.WXHeadimgurl = weixinInfo.HeadImgUrl; } //bll.Update(userInfo); } } } } string tip = string.Format("<img src='{0}' align='absmiddle' width='100px' height='100px'/><br/>{1}<br/>被<span style='color:red;'>{2}</span>次转发", wxHeadImg, wxNickName, count); var title = string.Format("<span style='color:blue;'>{0}</span> <span style='color:red;'>{1}</span>转发 [{2}]", wxNickName, count, string.Format("{0:f}", item.AccessDate)); sbRoot.Append("{"); sbRoot.AppendFormat("name: \"{0}\", id: \"{1}\", count:{2}, times: 1, isParent:\"{3}\",Ex_SpreadUserID:\"{4}\",Ex_ShareTimestamp:\"{5}\",icon:\"{6}\",tip:\"{7}\"", title, item.AutoID, "1", isParent.ToString().ToLower(), item.Ex_SpreadUserID, item.Ex_ShareTimestamp, icon, tip); sbRoot.Append("}"); if (i < rootList.Count - 1)//追加分隔符 { sbRoot.Append(","); } } RootNodes = sbRoot.ToString(); } else { RootNodes = "{ name: \"暂时没有转发记录\", id: \"0\", count: 0, times: 1, isParent: false }"; } }