protected void Page_Load(object sender, EventArgs e) { base.CheckProfile(Context); oS = CommonUtility.GetUserSession(Context); OrderListHTML=CustomerHelper.GetCustomerOrderList(oS.sCustomer.SysNo,0); }
protected void Page_Load(object sender, System.EventArgs e) { base.CheckProfile(Context); Response.Cache.SetCacheability(HttpCacheability.NoCache); oSession = CommonUtility.GetUserSession(Context); Hashtable ht = CartManager.GetInstance().GetCartHash(); ShoppingCartHTML = CustomerHelper.GetCustomerShoppingCart(ht); }
/// <summary> /// 获得用户的session /// </summary> /// <param name="context"></param> /// <returns></returns> public static IcsonSessionInfo GetUserSession(HttpContext context) { IcsonSessionInfo oSession = (IcsonSessionInfo)context.Session["IcsonSessionInfo"]; if (oSession == null) { oSession = new IcsonSessionInfo(); context.Session["IcsonSessionInfo"] = oSession; } return oSession; }
protected void Page_Load(object sender, EventArgs e) { base.CheckProfile(Context); // Put user code to initialize the page here oSession = CommonUtility.GetUserSession(Context); if (oSession.sCustomer.DwellAreaSysNo == AppConst.IntNull && oSession.sCustomer.ReceiveAreaSysNo == AppConst.IntNull) { tabInfo.Visible = true; lnkInfo.NavigateUrl = "../User/MyAddress.aspx"; } else { tabInfo.Visible = false; //this.soInfo = oSession.sSO; //soInfo.VATEMSFee = 0; //soInfo.VatInfo.VATEMSFee = 0; //oSession.sSO = this.soInfo; //Response.Redirect("CheckOut.aspx"); Response.Redirect("Comfirm.aspx"); } }
/// <summary> /// 注册新用户 /// </summary> public static bool RegisterNewCustomer(HttpContext context, NewRegisterCustomerModel customer, out string msg) { bool isSuccess = false; msg = String.Empty; string customerID = customer.CustomerID.Trim(); string password1 = customer.PassWordInput1.Trim(); string password2 = customer.PassWordInput2.Trim(); string customerEmail = customer.CustomerEmail.Trim(); if (customerID == "") { msg += "请输入用户名!<br />"; } else if (!CommonUtility.IsValidNum(customerID, "^[\u4e00-\u9fa5a-zA-Z]+$"))//原需求只允许中英文 { msg += "用户名只能包含中英文字符!<br />"; } else if (customerID.Length < 3 || customerID.Length > 20) { msg += "用户名长度必须大于等于3个字符!<br />"; } if (password1 == "") { msg += "请输入密码!<br />"; } else if (!CommonUtility.IsValidNum(password1, "[a-zA-Z0-9]+$"))//原需求只允许英文数字组合 { msg += "密码只能是英文数字组合!<br />"; } else if (password1.Length < 6 || password1.Length > 20) { msg += "密码长度必须大于等于6个字符!<br />"; } else if (password2 == "") { msg += "请输入确认密码!<br />"; } else if (password2 != password1) { msg += "请确保两次输入的密码一致!<br />"; } if (customerEmail == "") { msg += "请输入电子邮箱!<br />"; } else if (!Util.IsEmailAddress(customerEmail)) { msg += "请正确输入电子邮箱地址!"; } try { //定义一个用户对象并赋值 CustomerInfo oCustomer = new CustomerInfo(); //-----基础的三个信息,用户名,密码,邮箱---// oCustomer.CustomerID = customerID; //DESC加密用户密码 oCustomer.Pwd = DESProvider.EncryptString(password1, YoeJoyConfig.DESCEncryptKey); oCustomer.Email = customerEmail; //---其他信息---// oCustomer.EmailStatus = (int)AppEnum.EmailStatus.Origin; oCustomer.Status = (int)AppEnum.BiStatus.Valid; oCustomer.DwellAreaSysNo = AppConst.IntNull; oCustomer.ReceiveAreaSysNo = AppConst.IntNull; oCustomer.CustomerRank = (int)AppEnum.CustomerRank.Ordinary; oCustomer.IsManualRank = (int)AppEnum.YNStatus.No; oCustomer.CustomerType = (int)AppEnum.CustomerType.Personal; oCustomer.RegisterTime = DateTime.Now; oCustomer.LastLoginTime = DateTime.Now; oCustomer.LastLoginIP = context.Request.UserHostAddress; oCustomer.ValidScore = 0; oCustomer.TotalScore = 0; oCustomer.ValidFreeShipFee = 0; oCustomer.TotalFreeShipFee = 0; //注册操作 CustomerManager.GetInstance().Insert(oCustomer); IcsonSessionInfo oSession = (IcsonSessionInfo)context.Session["IcsonSessionInfo"]; if (oSession == null) { oSession = new IcsonSessionInfo(); context.Session["IcsonSessionInfo"] = oSession; } //指定当前用户为注册的用户 oSession.sCustomer = oCustomer; isSuccess = true; } catch (BizException exp) { msg = exp.Message; } catch (Exception ex) { ErrorLog.GetInstance().Write(ex.ToString()); string url = "../CustomError.aspx?msg=" + context.Server.UrlEncode("用户注册失败!"); context.Response.Redirect(url); } if (isSuccess) { //Response.Redirect("../Customer/NewCustomer.aspx?Type=success"); msg += "注册成功"; //lblErrmsg.Text = "恭喜您,注册成功!<br/>"; //lblErrmsg.Text += "<a href='../Account/AccountCenter.aspx'><span style='color:#FF298F'>请点击进入用户中心!</ span></ a>"; //Response.Redirect("../Account/AccountCenter.aspx"); } return isSuccess; }
protected void btnSave_Click(object sender, System.Web.UI.ImageClickEventArgs e) { if (txtName.Text.Trim() == "") { lblErrMsg.Text = "����������������"; return; } if (txtNickname.Text.Trim() == "") { lblErrMsg.Text = "�����������dzƣ�"; return; } if (txtDwellAddress.Text.Trim() == "") { lblErrMsg.Text = "��������ϵ��ַ��"; return; } if (txtPhone.Text.Trim() == "") { lblErrMsg.Text = "��������ϵ�绰��"; return; } if (scArea.DistrictSysNo == AppConst.IntNull) { lblErrMsg.Text = "��ѡ�����(����ʡ���С�����)"; return; } if (txtCellPhone.Text.Trim() != "") { if (!Util.IsCellNumber(txtCellPhone.Text.Trim())) { lblErrMsg.Text = "�ֻ������ʽ����ȷ�������Բ�����"; return; } } if (txtZip.Text.Trim() == "") { lblErrMsg.Text = "�������������룡"; return; } if (txtZip.Text.Trim() != "") { if (!Util.IsZipCode(txtZip.Text.Trim())) { lblErrMsg.Text = "���������ʽ����ȷ��"; return; } } if (String.IsNullOrEmpty(txtBirthDay.Text.ToString())) { lblErrMsg.Text = "���ղ���Ϊ��"; return; } if (!Util.IsEmailAddress(txtEmail.Text.Trim())) { lblErrMsg.Text = "Email��ַ��ʽ����ȷ"; return; } IcsonSessionInfo oSession = (IcsonSessionInfo)Session["IcsonSessionInfo"]; if (oSession == null) { oSession = new IcsonSessionInfo(); Session["IcsonSessionInfo"] = oSession; } if (oSession.sCustomer == null || oSession.sCustomer.SysNo == AppConst.IntNull) { string url = "../CustomError.aspx?msg=" + Server.UrlEncode("ȱ��ע����Ϣ�����ܸ��»����ע�ᣬ���¼"); Response.Redirect(url); } bool isOK = false; CustomerInfo oCustomer = oSession.sCustomer; try { oCustomer.CustomerName = txtName.Text.Trim(); oCustomer.NickName = txtNickname.Text.Trim(); oCustomer.Gender = int.Parse(rblGeneder.SelectedItem.Value.Trim()); oCustomer.Phone = txtPhone.Text.Trim(); oCustomer.CellPhone = txtCellPhone.Text.Trim(); oCustomer.Fax = txtFax.Text.Trim(); oCustomer.DwellAreaSysNo = scArea.AreaSysNo; oCustomer.DwellZip = txtZip.Text.Trim(); oCustomer.DwellAddress = txtDwellAddress.Text.Trim(); oCustomer.Email = txtEmail.Text.Trim(); oCustomer.BirthDay = txtBirthDay.Text.Trim(); Hashtable ht = new Hashtable(20); ht.Add("SysNo", oCustomer.SysNo); ht.Add("CustomerName", oCustomer.CustomerName); ht.Add("Nickname", oCustomer.NickName); ht.Add("Gender", oCustomer.Gender); ht.Add("Phone", oCustomer.Phone); ht.Add("CellPhone", oCustomer.CellPhone); ht.Add("Fax", oCustomer.Fax); ht.Add("DwellAreaSysNo", oCustomer.DwellAreaSysNo); ht.Add("DwellZip", oCustomer.DwellZip); ht.Add("DwellAddress", oCustomer.DwellAddress); ht.Add("Email", oCustomer.Email); ht.Add("Birthday", oCustomer.BirthDay); CustomerManager.GetInstance().Update(ht); isOK = true; lblErrMsg.Text = "���¸�����Ϣ�ɹ�"; } catch (BizException exp) { lblErrMsg.Text = exp.Message; } catch (Exception exp) { ErrorLog.GetInstance().Write(exp.ToString()); string url = "../CustomError.aspx?msg=" + Server.UrlEncode("�����û���Ϣʧ��"); Response.Redirect(url); } if (this.opt == "New" && isOK) { //��ע���û�����ϵ��������ΪĬ�ϵ��ջ���ַ��ӵ��ջ���ַ���� CustomerAddressInfo caInfo = new CustomerAddressInfo(); caInfo.CustomerSysNo = oCustomer.SysNo; caInfo.Brief = "�ջ���ַ1"; caInfo.Contact = txtName.Text.Trim(); caInfo.Name = txtName.Text.Trim(); caInfo.Phone = txtPhone.Text.Trim(); caInfo.CellPhone = txtCellPhone.Text.Trim(); caInfo.Fax = txtFax.Text.Trim(); caInfo.AreaSysNo = scArea.AreaSysNo; caInfo.Zip = txtZip.Text.Trim(); caInfo.Address = txtDwellAddress.Text.Trim(); caInfo.IsDefault = (int)AppEnum.BiStatus.Valid; caInfo.UpdateTime = DateTime.Now; CustomerManager.GetInstance().InsertCustomerAddress(caInfo); Response.Redirect("../Account/AddressManagement.html"); //Response.Redirect("Register2.aspx?opt=reg"); } }
protected void Page_Load(object sender, System.EventArgs e) { IcsonSessionInfo oSession = (IcsonSessionInfo)Session["IcsonSessionInfo"]; if (oSession == null) { oSession = new IcsonSessionInfo(); Session["IcsonSessionInfo"] = oSession; } if (oSession.sCustomer == null || oSession.sCustomer.SysNo == AppConst.IntNull) { string url = "login.aspx"; Response.Redirect(url); } if (Request.QueryString["Type"] != null) { this.opt = Request.QueryString["Type"].ToString(); } CustomerInfo oCustomer = oSession.sCustomer; if (oCustomer.EmailStatus == (int)AppEnum.EmailStatus.Confirmed) { lblEmail.Visible = true; txtEmail.Visible = false; } else { lblEmail.Visible = false; txtEmail.Visible = true; } if (!Page.IsPostBack) { lbUserId.Text = oSession.sCustomer.CustomerID; DatePickerUtil.GetInstance().setDatePickerBox(txtBirthDay); scArea.BindArea(); if (this.opt != "reg") { txtName.Text = oCustomer.CustomerName; rblGeneder.SelectedIndex = rblGeneder.Items.IndexOf(rblGeneder.Items.FindByValue(oCustomer.Gender.ToString().Trim())); txtCellPhone.Text = oCustomer.CellPhone; txtPhone.Text = oCustomer.Phone; if (oCustomer.DwellAreaSysNo != 1)//�����new user��Ĭ��ֵ�� scArea.AreaSysNo = oCustomer.DwellAreaSysNo; txtDwellAddress.Text = oCustomer.DwellAddress; txtZip.Text = oCustomer.DwellZip; txtFax.Text = oCustomer.Fax; lblEmail.Text = oCustomer.Email + "(����Ҫȡ����֤)"; txtBirthDay.Text = oCustomer.BirthDay; txtNickname.Text = oCustomer.NickName; } txtEmail.Text = oCustomer.Email; } }
protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here this.btnCancel.Attributes.Add("onclick", "return confirm('您确认要作废订单吗?')"); if (Request.QueryString["ID"] != null && Util.IsNaturalNumber(Request.QueryString["ID"])) soSysNo = int.Parse(Request.QueryString["ID"]); else this.ShowError("此订单不存在,请重试"); oSession = CommonUtility.GetUserSession(Context); soInfo = SaleManager.GetInstance().LoadSO(soSysNo); if (soInfo.CustomerSysNo != oSession.sCustomer.SysNo) this.ShowError("抱歉,您无权查看他人订单"); if (Request.QueryString["action"] == "update") { PanelShow.Visible = false; PanelUpdate.Visible = true; btnUpdate.Visible = true; } else { PanelShow.Visible = true; PanelUpdate.Visible = false; btnUpdate.Visible = false; } if (soInfo.PayTypeSysNo == 13) //支付宝即时到帐付款 { trSOAlipay.Visible = true; } else { trSOAlipay.Visible = false; } lblResult.Text = ""; lblResult.Visible = false; if (!Page.IsPostBack) { this.BindPage(); BindShipTypeGrid(); BindPayTypeGrid(); BindAddressList(); } }
protected void Page_Load(object sender, EventArgs e) { base.CheckProfile(Context); oSession = CommonUtility.GetUserSession(Context); if (!IsPostBack) { scArea.BindArea(); BindAddressList(); InitGift(); } }
//private bool HasEnoughAvailableQty = true; protected void Page_Load(object sender, System.EventArgs e) { base.CheckProfile(Context); oSession = CommonUtility.GetUserSession(Context); this.GetLastOneSo(); this.GetSOInfo(); //btnOK.Attributes["onclick"] = "OKClicked()"; if (!IsPostBack) { if (soInfo.ShipTypeSysNo == 1) { trSignByOther.Visible = true; } else { trSignByOther.Visible = false; } SaleManager.GetInstance().CalcSO(soInfo); this.BindSO(); //客户是否存在未出库可以合并的订单 trIsMergeSO.Visible = false; int AreaSysNo = SaleManager.GetInstance().GetCustomerUnOutstockSOReceiveArea(oSession.sCustomer.SysNo); if (AreaSysNo != AppConst.IntNull && AreaSysNo == soInfo.ReceiveAreaSysNo) { trIsMergeSO.Visible = true; } //ucSelectDeliveryTime.BindDeliveryDateTime(HasEnoughAvailableQty, DateTime.Now, 12); if (chkInvoice.Checked == true) vatInfo.Style.Add("display", "block"); else vatInfo.Style.Add("display", "none"); //if (soInfo.SOAmt < 10) //{ trPP.Visible = false; //} if (trPP.Visible && soInfo.SOAmt >= 10) { int ppMaxNum = Util.DecimalToU_Int32(soInfo.SOAmt) / 100 + 1; if (ppMaxNum > 10) ppMaxNum = 10; string time = DateTime.Now.ToString("yyyyMMddmmssms"); string key = ""; string md5 = Util.GetMD5(time + ppMaxNum.ToString() + key).ToUpper(); ppLink = "<a href='http://club.pchome.net/union/icson/?time=" + time + "&maxNum=" + ppMaxNum.ToString() + "&mac=" + md5 + "' target='_blank' style='text-decoration: underline;font-weight:bolder;color: #ff0033'>获得校验码</a></td>"; } if (soInfo.CouponAmt > 0) { int ppNum = Util.DecimalToU_Int32(soInfo.SOAmt) / 100 + 1; if (soInfo.CouponAmt > ppNum * 2) soInfo.CouponAmt = ppNum * 2; } } }