protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; int queryInt = WebUtils.GetQueryInt("oid"); string queryString = WebUtils.GetQueryString("osn"); if (queryInt > 0) { this.order = Orders.GetDataById(queryInt); } else if (!string.IsNullOrEmpty(queryString)) { this.order = Orders.GetOrderBySN(queryString); } if (this.order == null) { this.Alert(base.GetCaption("Order_NoFindOrderInfo"), UrlRewrite.Get("myorders_url")); } else { base.Put("order", this.order); base.Put("kuaidi100url", this.GetKuaidi100Url()); base.UsingClient("user/订单详情.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; string text = WebUtils.GetQueryString("opid").TrimEnd(new char[] { ',' }); if (!string.IsNullOrEmpty(text)) { string action = this.Action; if (action != null) { if (action == "delete") { if (PageBase.dbo.UpdateTable(" delete from cms_AccountDetail where AutoID in (" + text + ") ")) { base.Response.Redirect("/User/Integral.aspx"); } } } } this.PageSize = 15; this.Condition = " 1=1 AND Unit='Integral' and UserID= " + base.UserID.ToString(); this.UrlPattern = UrlRewrite.Get("integral_url") + "?page=$page"; base.AutoPageing <AccountDetailInfo>(new AccountDetailInfo()); base.UsingClient("user/我的积分.html"); }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; if (base.IsPost) { UserInfo dataById = SinGooCMS.BLL.User.GetDataById(base.UserID); dataById.NickName = WebUtils.GetFormString("NickName"); dataById.Gender = WebUtils.GetFormString("Gender"); dataById.Birthday = WebUtils.GetFormDatetime("Birthday"); string text = base.UploadFileByUser("headerphoto"); if (!string.IsNullOrEmpty(text)) { dataById.HeaderPhoto = text; } if (SinGooCMS.BLL.User.Update(dataById)) { base.Response.Redirect(UrlRewrite.Get("profile_url")); } else { this.Alert(base.GetCaption("Profile_UpdateFail")); } } else { System.Collections.Generic.IEnumerable <UserGroupInfo> enumerable = from p in UserGroup.GetCacheUserGroupList() where p.GroupName.Equals(base.LoginUserGroup.GroupName) select p; base.Put("usermodel", SinGooCMS.BLL.User.GetFieldListWithValue(base.UserID, (enumerable == null) ? 0 : enumerable.FirstOrDefault <UserGroupInfo>().AutoID)); base.UsingClient("user/个人资料.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; int queryInt = WebUtils.GetQueryInt("id"); if (this.Action.Equals("cancel")) { FavoritesInfo dataById = Favorites.GetDataById(queryInt); if (dataById != null) { Favorites.Delete(queryInt); } base.Response.Redirect(UrlRewrite.Get("myfavorite_url")); } this.PageSize = 12; this.Condition = "1=1 AND UserID=" + base.UserID.ToString(); this.UrlPattern = UrlRewrite.Get("myfavorite_url") + "?page=$page"; DataSet pagerDataExt = Favorites.GetPagerDataExt(" * ", this.Condition, this.Sort, this.PageSize, this.PageIndex, ref this.TotalCount, ref this.TotalPage); DataTable dataTable = (pagerDataExt != null && pagerDataExt.Tables.Count > 0) ? pagerDataExt.Tables[0] : new DataTable(); CMSPager pager = this.contents.GetPager(this.TotalCount, this.PageIndex, this.PageSize, this.UrlPattern); base.Put("pager", pager); base.Put("jcdatas", dataTable.Rows); base.Put("condition", this.Condition); base.UsingClient("user/我的收藏.html"); }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; string text = WebUtils.GetQueryString("opid").TrimEnd(new char[] { ',' }); if (!string.IsNullOrEmpty(text)) { string action = this.Action; if (action != null) { if (!(action == "read")) { if (action == "delete") { if (PageBase.dbo.UpdateTable(" delete from sys_Message where AutoID in (" + text + ") ")) { base.Response.Redirect(UrlRewrite.Get("message_url")); } } } else if (PageBase.dbo.UpdateTable(" update sys_Message set IsRead=1,ReadTime=getdate() where AutoID in (" + text + ") ")) { base.Response.Redirect(UrlRewrite.Get("message_url")); } } } this.Condition = "1=1 AND ReceiverType='user' AND Receiver='" + base.UserName + "' "; this.UrlPattern = UrlRewrite.Get("message_url") + "?page=$page"; base.AutoPageing <MessageInfo>(new MessageInfo()); base.UsingClient("user/我的消息.html"); }
protected void Page_Load(object sender, System.EventArgs e) { string text = WebUtils.GetQueryString("tourl"); if (string.IsNullOrEmpty(text)) { text = UrlRewrite.Get("login_url"); } HttpCookie httpCookie = new HttpCookie("singoouser"); httpCookie.Expires = System.DateTime.Now.AddDays(-1.0); HttpContext.Current.Response.SetCookie(httpCookie); HttpContext.Current.Response.Redirect(text); }
protected void Page_Load(object sender, System.EventArgs e) { if (base.IsPost) { UserInfo userInfo = new UserInfo(); string formString = WebUtils.GetFormString("_loginname"); string formString2 = WebUtils.GetFormString("_loginpwd"); bool flag = WebUtils.GetFormInt("_loginremeber").Equals(1); if (PageBase.config.VerifycodeForLogin && string.Compare(base.ValidateCode, WebUtils.GetFormString("_loginyzm"), true) != 0) { base.WriteJsonTip(base.GetCaption("ValidateCodeIncorrect")); } else { LoginStatus loginStatus = SinGooCMS.BLL.User.UserLogin(formString, formString2, ref userInfo); if (loginStatus == LoginStatus.Success) { if (flag) { CookieUtils.SetCookie("_remeberusername", userInfo.UserName, 31536000); } string text = base.Server.UrlDecode(WebUtils.GetFormString("_loginreturnurl")); if (!string.IsNullOrEmpty(text)) { base.WriteJsonTip(true, "Đăng nhập thành công", text); } else { base.WriteJsonTip(true, "Đăng nhập thành công", UrlRewrite.Get("infocenter_url")); } } else if (loginStatus == LoginStatus.MutilLoginFail) { base.WriteJsonTip(base.GetCaption("Login_LoginFailTooMany").Replace("${num}", PageBase.config.TryLoginTimes.ToString())); } else { base.WriteJsonTip(base.GetCaption("Login_FailWithMsg").Replace("${msg}", base.GetCaption("LoginStatus_" + loginStatus.ToString()))); } } } else { base.Put("remeberusername", CookieUtils.GetCookie("_remeberusername")); base.Put("returnurl", (base.Request.Url.ToString().IndexOf("?returnurl=") == -1) ? "" : base.Request.Url.ToString().Substring(base.Request.Url.ToString().IndexOf("?returnurl=") + "?returnurl=".Length)); base.Put("thirdlogin", OAuthConfig.Load()); base.UsingClient("user/login.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; this.PageSize = 12; this.Condition = " 1=1 AND UserName='******' AND IsUsed=0 AND GETDATE()<EndTime "; this.UrlPattern = UrlRewrite.Get("coupons_url") + "?page=$page"; DataSet pagerData = SinGooCMS.BLL.Coupons.GetPagerData("*,(case when DATEDIFF(HOUR,GETDATE(),EndTime) between 0 and 24 then 1 else 0 end) as willexpire", this.Condition, this.Sort, this.PageSize, this.PageIndex, ref this.TotalCount, ref this.TotalPage); DataTable dataTable = (pagerData != null && pagerData.Tables.Count > 0) ? pagerData.Tables[0] : new DataTable(); CMSPager pager = this.contents.GetPager(this.TotalCount, this.PageIndex, this.PageSize, this.UrlPattern); base.Put("pager", pager); base.Put("jcdatas", dataTable.Rows); base.Put("condition", this.Condition); base.UsingClient("user/优惠券.html"); }
protected void Page_Load(object sender, System.EventArgs e) { if (base.IsPost) { UserInfo userInfo = new UserInfo(); userInfo = SinGooCMS.BLL.User.GetUserByName(WebUtils.GetFormString("_uname")); if (userInfo == null) { base.WriteJsonTip(base.GetCaption("GetPwd_UserNotExist")); } else { base.WriteJsonTip(true, "用户名正确", UrlRewrite.Get("resetpwd_url") + "?uid=" + DEncryptUtils.DESEncode(userInfo.AutoID.ToString())); } } else { base.UsingClient("user/找回密码.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; base.ReturnUrl = base.Request.RawUrl; if (base.IsPost) { this.Action = WebUtils.GetFormString("action").ToLower(); OrdersInfo dataById = Orders.GetDataById(WebUtils.GetFormInt("oid")); if (!string.IsNullOrEmpty(this.Action) && dataById != null) { string action = this.Action; if (action != null) { if (!(action == "sign")) { if (!(action == "cancel")) { if (action == "delete") { if (dataById != null && dataById.OrderStatus >= 99) { Orders.Delete(dataById.AutoID); OrderItem.DeleteItemByOrderID(dataById.AutoID); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } } else if (dataById != null && dataById.OrderStatus <= 1) { System.Collections.Generic.IList <OrderItemInfo> listByOID = OrderItem.GetListByOID(dataById.AutoID); if (listByOID.Count > 0) { foreach (OrderItemInfo current in listByOID) { Orders.ReBackStock(Product.GetDataById(current.ProID), GoodsSpecify.Get(current.ProID, current.GuiGePath), current.Quantity); } } OrderAction.AddLog(dataById, base.UserName, "会员[" + base.UserName + "]取消了订单"); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } else if (dataById != null && dataById.OrderStatus == 11) { dataById.GoodsServedTime = System.DateTime.Now; dataById.OrderFinishTime = System.DateTime.Now; dataById.OrderStatus = 99; if (Orders.Update(dataById)) { OrderAction.AddLog(dataById, base.UserName, "会员[" + base.UserName + "]签收了订单"); base.WriteJsonTip(true, base.GetCaption("OperationSuccess"), UrlRewrite.Get("myorders_url")); } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } else { base.WriteJsonTip(base.GetCaption("Order_StatusIncorrect")); } } } } else { Orders.CancelExpireOrder(base.UserID); Orders.AutoSignOrder(base.UserID); this.Condition = this.Condition + " 1=1 AND UserID=" + base.UserID.ToString(); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); System.DateTime dateTime = WebUtils.GetQueryDatetime("filter_dtstart"); System.DateTime dateTime2 = WebUtils.GetQueryDatetime("filter_dtend"); if (dateTime == new System.DateTime(1900, 1, 1)) { dateTime = System.DateTime.Now.AddYears(-1); } if (dateTime2 == new System.DateTime(1900, 1, 1)) { dateTime2 = System.DateTime.Now; } if (dateTime2 < dateTime) { dateTime2 = dateTime.AddMonths(1); } if (dateTime2 > dateTime.AddYears(5)) { dateTime2 = dateTime.AddYears(5); this.Alert("仅允许查询5年之内的数据"); } int queryInt = WebUtils.GetQueryInt("filter_status", -1); int queryInt2 = WebUtils.GetQueryInt("filter_ordertype", -1); string queryString = WebUtils.GetQueryString("filter_searchkey"); base.Put("filter_dtstart", dateTime.ToString("yyyy-MM-dd")); base.Put("filter_dtend", dateTime2.ToString("yyyy-MM-dd")); base.Put("filter_status", queryInt); base.Put("filter_ordertype", queryInt2); base.Put("filter_searchkey", queryString); stringBuilder.Append(string.Concat(new string[] { " AND OrderAddTime between CONVERT(datetime,'", dateTime.ToString("yyyy-MM-dd"), " 00:00:00') and CONVERT(datetime,'", dateTime2.ToString("yyyy-MM-dd"), " 23:59:59') " })); if (queryInt != -1) { if (queryInt == 12) { stringBuilder.Append(" AND OrderStatus>11 and OrderStatus<=99 and exists(select 1 from shop_OrderItem where OrderID=shop_Orders.AutoID and IsEva=0) "); } else { stringBuilder.Append(" AND OrderStatus= " + queryInt); } } if (queryInt2 != -1) { stringBuilder.Append(" AND OrderType= " + queryInt2); } if (!string.IsNullOrEmpty(queryString)) { stringBuilder.Append(" AND OrderNo like '%" + queryString + "%' "); } this.Condition += stringBuilder.ToString(); this.UrlPattern = string.Concat(new object[] { UrlRewrite.Get("myorders_url"), "?filter_dtstart=", dateTime.ToString("yyyy-MM-dd"), "&filter_dtend=", dateTime2.ToString("yyyy-MM-dd"), "&filter_status=", queryInt, "&filter_ordertype=", queryInt2, "&filter_searchkey=", queryString, "&page=$page" }); OrderStatusSTAT orderStatusSTAT = new OrderStatusSTAT(base.UserID); base.Put("AllCount", orderStatusSTAT.AllCount); base.Put("DaiFKCount", orderStatusSTAT.WaitPayCount); base.Put("DaiFHCount", orderStatusSTAT.WaitSendGoodsCount); base.Put("DaiSHCount", orderStatusSTAT.WaitSignGoodsCount); base.Put("DaiPJCount", orderStatusSTAT.WaitEvaCount); base.Put("SuccessCount", orderStatusSTAT.SuccessCount); base.AutoPageing <OrdersInfo>(new OrdersInfo()); base.UsingClient("user/我的订单.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; if (base.IsPost && base.UserID != -1) { string text = WebUtils.GetFormString("_action", "add").ToLower(); int formInt = WebUtils.GetFormInt("_addrid"); ShippingAddressInfo shippingAddressInfo = new ShippingAddressInfo(); if (text.Equals("modify")) { shippingAddressInfo = ShippingAddress.GetDataById(formInt); } shippingAddressInfo.UserID = base.UserID; shippingAddressInfo.Consignee = WebUtils.GetFormString("_consignee"); shippingAddressInfo.Country = "中国"; string formString = WebUtils.GetFormString("_area"); string[] array = formString.Split(new char[] { ',' }); shippingAddressInfo.Province = ((array.Length > 0) ? array[0] : string.Empty); shippingAddressInfo.City = ((array.Length > 1) ? array[1] : string.Empty); shippingAddressInfo.County = ((array.Length > 2) ? array[2] : string.Empty); shippingAddressInfo.Address = WebUtils.GetFormString("_address"); shippingAddressInfo.PostCode = WebUtils.GetFormString("_postcode"); shippingAddressInfo.ContactPhone = WebUtils.GetFormString("_contactphone"); shippingAddressInfo.IsDefault = (WebUtils.GetFormString("_isdefault").ToUpper() == "ON"); if (string.IsNullOrEmpty(shippingAddressInfo.Consignee)) { base.WriteJsonTip(base.GetCaption("Addr_ConsigneeNotEmpty")); } else if (string.IsNullOrEmpty(shippingAddressInfo.Address)) { base.WriteJsonTip(base.GetCaption("Addr_DetailAddrNotEmpty")); } else if (string.IsNullOrEmpty(shippingAddressInfo.ContactPhone)) { base.WriteJsonTip(base.GetCaption("Addr_MobileOrPhoneMustOne")); } else if (text == "modify") { if (ShippingAddress.Update(shippingAddressInfo)) { if (shippingAddressInfo.IsDefault) { ShippingAddress.SetDefShippingAddr(shippingAddressInfo.AutoID, base.UserID); } base.WriteJsonTip(true, base.GetCaption("Addr_Success"), UrlRewrite.Get("myaddress_url")); } else { base.WriteJsonTip(base.GetCaption("Addr_UpdateFail")); } } else { shippingAddressInfo.AutoTimeStamp = System.DateTime.Now; int num = ShippingAddress.Add(shippingAddressInfo); if (num > 0) { if (shippingAddressInfo.IsDefault) { ShippingAddress.SetDefShippingAddr(num, base.UserID); } base.WriteJsonTip(true, base.GetCaption("Addr_Success"), UrlRewrite.Get("myaddress_url")); } else { base.WriteJsonTip(base.GetCaption("Addr_AddFail")); } } } else { this.Action = WebUtils.GetQueryString("action", "add"); int queryInt = WebUtils.GetQueryInt("id"); if (this.Action == "delete" && queryInt > 0 && ShippingAddress.Delete(queryInt)) { base.Response.Redirect(UrlRewrite.Get("myaddress_url")); } base.Put("action", this.Action); base.Put("curraddr", ShippingAddress.GetDataById(queryInt)); base.Put("addrlist", ShippingAddress.GetShippingAddrByUID(base.UserID)); base.UsingClient("user/收货地址.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (base.IsPost) { UserInfo userInfo = new UserInfo(); userInfo = SinGooCMS.BLL.User.GetUserByName(WebUtils.GetFormString("_uname")); string formString = WebUtils.GetFormString("_findpwdtype"); string strMobile = string.Empty; if (formString.Equals("bymobile")) { strMobile = userInfo.Mobile; } else { strMobile = userInfo.Email; } string formString2 = WebUtils.GetFormString("_newpwd"); SMSInfo lastCheckCode = SMS.GetLastCheckCode(strMobile); if (lastCheckCode == null) { base.WriteJsonTip(base.GetCaption("GetPwd_NoSendMobileValidateCodeYet")); } else if (string.Compare(WebUtils.GetFormString("_fourcode"), lastCheckCode.ValidateCode, true) != 0) { base.WriteJsonTip(base.GetCaption("GetPwd_MobileValidateCodeIncorrect")); } else if (string.IsNullOrEmpty(formString2)) { base.WriteJsonTip(base.GetCaption("GetPwd_NewPwdNotEmpty")); } else if (formString2.Length < 6) { base.WriteJsonTip(base.GetCaption("GetPwd_NewPwdLenCannotLess6")); } else if (SinGooCMS.BLL.User.UpdatePassword(userInfo.AutoID, formString2)) { new MsgService(userInfo).SendFindPwdMsg(); base.WriteJsonTip(true, base.GetCaption("ResetPwd_Success"), UrlRewrite.Get("resetsuccess_url")); } else { base.WriteJsonTip(base.GetCaption("GetPwd_PasswordResetFailed")); } } else { UserInfo userInfo = new UserInfo(); int intPrimaryKeyIDValue = 0; try { intPrimaryKeyIDValue = WebUtils.GetInt(DEncryptUtils.DESDecode(WebUtils.GetQueryString("uid"))); } catch { intPrimaryKeyIDValue = 0; } userInfo = SinGooCMS.BLL.User.GetDataById(intPrimaryKeyIDValue); base.Put("curruser", userInfo); base.Put("useremail", string.IsNullOrEmpty(userInfo.Email) ? "没有绑定邮箱" : StringUtils.GetAnonymous(userInfo.Email)); base.Put("usermobile", string.IsNullOrEmpty(userInfo.Mobile) ? "没有绑定手机" : StringUtils.GetAnonymous(userInfo.Mobile)); base.UsingClient("user/找回密码方式.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { this.strCartID = this.shop.GetCartID(); this.strAction = WebUtils.GetQueryString("action").ToLower(); this.strIds = WebUtils.GetQueryString("ids"); if (!string.IsNullOrEmpty(this.strAction)) { string text = this.strAction; if (text != null) { if (!(text == "del")) { if (!(text == "clear")) { if (!(text == "plus")) { if (!(text == "minus")) { if (text == "quantity") { int queryInt = WebUtils.GetQueryInt("num", 1); CartInfo cart = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart != null) { GoodsSpecifyInfo dataById = GoodsSpecify.GetDataById(cart.GoodsAttr); int stock = cart.Product.Stock; if (dataById != null) { stock = dataById.Stock; } if (queryInt > stock) { cart.Quantity = stock; } else if (queryInt < 1) { cart.Quantity = 1; } else { cart.Quantity = queryInt; } cart.SubTotal = cart.Price * cart.Quantity; Cart.Update(cart); } } } else { CartInfo cart2 = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart2 != null) { if (cart2.Quantity > 1) { cart2.Quantity--; } cart2.SubTotal = cart2.Price * cart2.Quantity; Cart.Update(cart2); } } } else { CartInfo cart3 = Cart.GetCart(WebUtils.GetInt(this.strIds)); if (cart3 != null) { GoodsSpecifyInfo dataById = GoodsSpecify.GetDataById(cart3.GoodsAttr); int stock = cart3.Product.Stock; if (dataById != null) { stock = dataById.Stock; } if (cart3.Quantity < stock) { cart3.Quantity++; } cart3.SubTotal = cart3.Price * cart3.Quantity; Cart.Update(cart3); } } } else { Cart.ClearByCartID(this.strCartID); } } else if (!string.IsNullOrEmpty(this.strIds)) { Cart.Delete(this.strIds); } } base.Response.Redirect(UrlRewrite.Get("cart_url")); } else { System.Collections.Generic.IList <CartInfo> listByCartNo = Cart.GetListByCartNo(this.strCartID); foreach (CartInfo current in listByCartNo) { this.decTotalMoney += current.Quantity * current.Price; } base.Put("totalamount", this.decTotalMoney); base.UsingClient("购物车.html"); } }
protected void Page_Load(object sender, System.EventArgs e) { base.NeedLogin = true; if (base.IsPost) { string formString = WebUtils.GetFormString("_oldpwd"); string formString2 = WebUtils.GetFormString("_newpwd"); string formString3 = WebUtils.GetFormString("_newpwdconfirm"); if (string.IsNullOrEmpty(formString)) { base.WriteJsonTip(base.GetCaption("ChangePwd_OldPwdNotEmpty")); } else if (string.IsNullOrEmpty(formString2)) { base.WriteJsonTip(base.GetCaption("ChangePwd_NewPwdNotEmpty")); } else if (!formString2.Equals(formString3)) { base.WriteJsonTip(base.GetCaption("ChangePwd_2PwdInputNoMatch")); } else if (base.LoginUser.Password != SinGooCMS.BLL.User.GetEncodePwd(formString)) { base.WriteJsonTip(base.GetCaption("ChangePwd_OldPwdIncorrect")); } else if (SinGooCMS.BLL.User.UpdatePassword(base.UserID, formString2)) { new MsgService(SinGooCMS.BLL.User.GetDataById(base.UserID)).SendChangPwdMsg(); base.WriteJsonTip(true, base.GetCaption("ChangePwd_ModifyPwdSuccess"), UrlRewrite.Get("logout_url")); } else { base.WriteJsonTip(base.GetCaption("ChangePwd_ModifyPwdFail")); } } else { base.UsingClient("user/修改密码.html"); } }