protected void Page_Load(object sender, EventArgs e) { websiteInfo = DataLoadTool.GetWebsiteInfoModel(); if (string.IsNullOrEmpty(websiteInfo.MallType)) { websiteInfo.MallType = "0"; } model = bll.GetProduct(Request["pid"]); shareLink = Request.Url.AbsoluteUri; if (bll.GetWebsiteInfoModel().IsDistributionMall.Equals(1)) { if (bll.IsLogin) { UserInfo CurrentUserInfo = bll.GetCurrentUserInfo(); if (bll.IsWeiXinBrowser && (string.IsNullOrEmpty(CurrentUserInfo.WXNickname) || string.IsNullOrEmpty(CurrentUserInfo.WXHeadimgurl))) { Session.Clear(); Response.Redirect(Request.Url.AbsoluteUri); } if (string.IsNullOrEmpty(Request["sid"])) { shareLink = string.Format("http://{0}{1}?action=show&pid={2}&sid={3}", Request.Url.Host, Request.FilePath, Request["pid"], CurrentUserInfo.AutoID); } else { ShareUserInfo = bllUser.GetUserInfoByAutoID(int.Parse(Request["sid"])); } } else { Response.Write("请用微信打开"); Response.End(); } } }
/// <summary> /// 获取我的积分记录 /// </summary> /// <param name="context"></param> /// <returns></returns> private string List(HttpContext context) { if (!bllMall.IsLogin) { return(ZentCloud.Common.JSONHelper.ObjectToJson(new { errcode = (int)APIErrCode.UserIsNotLogin, errmsg = "请先登录" })); } var currentUserInfo = bllMall.GetCurrentUserInfo(); int pageIndex = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1; int pageSize = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10; string type = context.Request["score_type"]; string is_amount = context.Request["is_amount"]; System.Text.StringBuilder sbWhere = new System.Text.StringBuilder(string.Format(" UserId='{0}' ", currentUserInfo.UserID)); if (!string.IsNullOrEmpty(type)) { if (type == "0") { sbWhere.AppendFormat(" And Score <0"); } else { sbWhere.AppendFormat(" And Score >0"); } } if (is_amount == "1") { sbWhere.AppendFormat(" And ScoreType ='AccountAmount'"); } else { sbWhere.AppendFormat(" And ScoreType !='AccountAmount' And ScoreType !='TotalAmount' "); } int totalCount = bllScore.GetCount <UserScoreDetailsInfo>(sbWhere.ToString()); var sourceData = bllScore.GetLit <UserScoreDetailsInfo>(pageSize, pageIndex, sbWhere.ToString(), "AutoID DESC"); var list = from p in sourceData select new { title = p.AddNote, score = p.Score, time = bllMall.GetTimeStamp(p.AddTime) }; var data = new { totalcount = totalCount, list = list,//列表 }; return(ZentCloud.Common.JSONHelper.ObjectToJson(data)); }
protected void Page_Load(object sender, EventArgs e) { string orderid = null; orderid = Request["oid"]; if (string.IsNullOrEmpty(orderid)) { Response.End(); } if (bll.IsLogin) { userInfo = bll.GetCurrentUserInfo(); OrderInfo = bll.GetOrderInfo(orderid); if (OrderInfo == null) { Response.End(); } bool CanAccess = false; if (!OrderInfo.OrderUserID.Equals(userInfo.UserID)) { try { if (bll.GetWebsiteInfoModel().IsDistributionMall.Equals(1)) { //检查是否是上下级关系 BLLJIMP.BLLDistribution bllDis = new BLLJIMP.BLLDistribution(); BLLJIMP.BLLUser bllUser = new BLLJIMP.BLLUser(""); if (bllDis.GetUserBetweenLevel(userInfo, bllUser.GetUserInfo(OrderInfo.OrderUserID)) > 0) { CanAccess = true; } } } catch (Exception) { } } else { CanAccess = true; } if (!CanAccess) { Response.End(); } } else { Response.Redirect("/App/Cation/Wap/Login.aspx?redirecturl=/App/Cation/Wap/Mall/Index.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { IsLogin = bll.IsLogin; if (bll.IsLogin) { CurrentUserInfo = bll.GetCurrentUserInfo(); } PeopleCount = bll.GetCount <WXMallOrderInfo>(string.Format("WebsiteOwner='qianwei' And OrderUserID='system' And PaymentStatus=1")); TotalAmount = bll.GetList <WXMallOrderInfo>(string.Format("WebsiteOwner='qianwei' And OrderUserID='system' And PaymentStatus=1")).Sum(p => p.TotalAmount); ArticleModel = bllArticle.GetJuActivity(274374); if (ArticleModel == null) { ArticleModel = new JuActivityInfo(); } }
/// <summary> /// 是否已经收藏商品 /// </summary> /// <returns></returns> private int IsCollectProduct(int productId) { if (!bllMall.IsLogin) { return(0); } UserInfo currentUserInfo = bllMall.GetCurrentUserInfo(); string strWhere = string.Format("MainId='{0}' And RelationId='{1}' And RelationType='ProductCollect'", currentUserInfo.UserID, productId); int totalCount = bllMall.GetCount <CommRelationInfo>(strWhere); if (totalCount >= 1) { return(1); } return(0); }
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 (model.DiscountScore > 0) { model.Score = model.DiscountScore; } if (bllMall.IsLogin) { currentUserInfo = bllMall.GetCurrentUserInfo(); //if (currentUserInfo.Province==null) //{ // currentUserInfo.Province = "选择省"; //} //if (currentUserInfo.City == null) //{ // currentUserInfo.City = ""; //} //if (currentUserInfo.District == null) //{ // currentUserInfo.District = ""; //} } 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 SmsRemind(HttpContext context) { string promotionActivityId = context.Request["promotion_activity_id"];//限时特卖活动ID string phone = context.Request["phone"]; string smsContent = context.Request["sms_content"]; string sendTime = context.Request["send_time"]; if (!bllMall.IsLogin) { resp.errcode = 1; resp.errmsg = "请先登录"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } var currentUserInfo = bllMall.GetCurrentUserInfo(); if (string.IsNullOrEmpty(promotionActivityId)) { resp.errcode = 1; resp.errmsg = "promotion_activity_id 参数不能为空"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if (string.IsNullOrEmpty(phone)) { resp.errcode = 1; resp.errmsg = "phone 参数不能为空"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if ((!phone.StartsWith("1")) || (!phone.Length.Equals(11))) { resp.errcode = 2; resp.errmsg = "手机号格式不正确"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if (string.IsNullOrEmpty(smsContent)) { resp.errcode = 1; resp.errmsg = "sms_content 不能为空"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if (string.IsNullOrEmpty(sendTime)) { resp.errcode = 1; resp.errmsg = "send_time 参数不能为空"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } //检查是否已经有记录提醒 if (IsRemind(promotionActivityId, currentUserInfo.UserID) > 0) { resp.errcode = 1; resp.errmsg = "已经添加提醒"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } bool isSuccess = false; string msg = ""; string smsSignature = bllSms.GetWebsiteInfoModelFromDataBase().SmsSignature;//短信签名 if (string.IsNullOrEmpty(smsSignature)) { smsSignature = "至云"; } bllSms.SendSmsMisson(phone, smsContent, sendTime, smsSignature, out isSuccess, out msg); if (isSuccess) { CommRelationInfo model = new CommRelationInfo(); model.MainId = promotionActivityId; model.RelationId = currentUserInfo.UserID; model.RelationTime = DateTime.Now; model.RelationType = "PromotionSmsRemind"; if (bllMall.Add(model)) { resp.errcode = 0; resp.errmsg = "ok"; } else { resp.errcode = 4; resp.errmsg = string.Format("提交提醒失败", msg); } } else { resp.errcode = 4; resp.errmsg = string.Format("提交失败,错误码{0}", msg); } return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); }