protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { firstpane.InnerHtml = CreateNav(); BannerDiv.InnerHtml = MojoCube.Web.Site.Cache.GetSiteBanner(strLanguage, 1); hlLogin.NavigateUrl = MojoCube.Web.Site.Cache.GetUrlExtension("Login", strLanguage); this.Title = MojoCube.Web.String.GetTitle(hlTitle.Text, MojoCube.Web.Site.Cache.GetSiteTitle(strLanguage)); if (Request.QueryString["user"] != null && Request.QueryString["code"] != null) { lblInfo.Text = "您的邮箱已确认,请登录您的账号!"; MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); user.GetData(Request.QueryString["user"]); if (!user.IsCheck) { user.UpdateMember_CheckCode(Request.QueryString["user"], Request.QueryString["code"]); } } else { Response.Redirect(MojoCube.Web.Site.Cache.GetUrlExtension("Default", strLanguage)); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { //判断是否存在用户名及验证码是否正确 if (Session["SiteCheckCode"] == null) { MojoCube.Api.UI.Script.ScriptMessage(this, "请填写验证码"); return; } if (Session["SiteCheckCode"] != null && Session["SiteCheckCode"].ToString().ToLower() != txtCode.Text.Trim().ToLower()) { MojoCube.Api.UI.Script.ScriptMessage(this, "验证码错误"); return; } MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); if (user.ChkUser(txtPhone.Text.Trim(), txtEmail.Text.Trim()) && !user.IsCheck) { user.GetData(txtPhone.Text.Trim()); SendMail(user.Email, user.CheckCode, user.FirstName, user.LastName, user.UserName); MojoCube.Api.UI.Script.ScriptMessage(this, "确认邮件已经发送,请查收邮箱!"); } else if (user.pk_Member > 0 && user.IsCheck) { MojoCube.Api.UI.Script.ScriptMessage(this, "您的账号已经确认,请登录!"); } else { MojoCube.Api.UI.Script.ScriptMessage(this, "该手机号没有被注册!"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { MojoCube.Web.Order.List order = new MojoCube.Web.Order.List(); order.GetData(int.Parse(ViewState["pk_Order"].ToString())); order.IsComment = true; order.UpdateData(order.pk_Order); if (GridView1.Rows.Count > 0) { MojoCube.Web.Member.List member = new MojoCube.Web.Member.List(); member.GetData(int.Parse(Session["Member_UserID"].ToString())); MojoCube.Web.Comment.List list = new MojoCube.Web.Comment.List(); for (int i = 0; i < GridView1.Rows.Count; i++) { if (((TextBox)GridView1.Rows[i].FindControl("txtComment")).Text.Trim() != "") { list.Title = ((Label)GridView1.Rows[i].FindControl("lblTitle")).Text; list.Subtitle = string.Empty; list.Description = ((TextBox)GridView1.Rows[i].FindControl("txtComment")).Text.Trim(); list.Feedback = string.Empty; list.Visual = string.Empty; list.Author = member.LastName + member.FirstName; list.Email = member.Email; list.Phone = member.Phone1; list.Address = member.Address; list.Website = string.Empty; list.IPAddress = MojoCube.Web.IP.Get(); list.Browser = MojoCube.Web.String.GetBrowserInfo(); list.Issue = true; list.IsComment = false; list.IsRecommend = false; list.IsRead = false; list.ReadDate = DateTime.Now.ToString(); list.Clicks = 0; list.fk_ID = int.Parse(((Label)GridView1.Rows[i].FindControl("lblfkID")).Text); list.SortID = 0; list.TypeID = 1; list.StatusID = 0; list.Score = int.Parse(((DropDownList)GridView1.Rows[i].FindControl("ddlScore")).SelectedValue); list.ScoreIn = list.Score; list.CreateDate = DateTime.Now.ToString(); list.CreateUserID = member.pk_Member; list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = 0; list.Language = MojoCube.Api.UI.Language.GetLanguage(); list.InsertData(); } } } Response.Redirect(MojoCube.Web.Site.Cache.GetUrlExtension("OrderDetail", MojoCube.Api.UI.Language.GetLanguage()) + "?id=" + MojoCube.Api.Text.Security.EncryptString(ViewState["pk_Order"].ToString())); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WUC_MemberMenu.CssFocus = "id=\"Menu5\""; BannerDiv.InnerHtml = MojoCube.Web.Site.Cache.GetSiteBanner(strLanguage, 1); MojoCube.Web.Member.List list = new MojoCube.Web.Member.List(); list.GetData(int.Parse(Session["Member_UserID"].ToString())); txtPhone.Text = list.Phone1; txtName.Text = list.LastName + list.FirstName; txtEmail.Text = list.Email; txtAddress.Text = list.Address; imgPortrait.ImageUrl = "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(Session["Member_UserImagePath"].ToString()); } this.Title = MojoCube.Web.String.GetTitle(hlTitle.Text, MojoCube.Web.Site.Cache.GetSiteTitle(strLanguage)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hlBack.NavigateUrl = "List.aspx?active=" + Request.QueryString["active"]; if (Request.QueryString["id"] != null) { EditDiv.Visible = true; ViewState["pk_Member"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]); MojoCube.Web.Member.List list = new MojoCube.Web.Member.List(); list.GetData(int.Parse(ViewState["pk_Member"].ToString())); txtName.Text = list.UserName; txtPhone.Text = list.Phone1; txtLastName.Text = list.LastName; txtFirstName.Text = list.FirstName; txtEmail.Text = list.Email; txtAddress.Text = list.Address; txtBirthday.Text = DateTime.Parse(list.Birthday).ToString("yyyy-MM-dd"); MojoCube.Web.Sql.ddlFindByValue(ddlSex, list.Sex.ToString()); if (list.ImagePath != "") { imgPortrait.ImageUrl = "../Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(list.ImagePath) + "&cut=200,200"; } else { imgPortrait.ImageUrl = "../Images/user.png"; } this.Title = "会员编辑:" + txtName.Text.Trim(); } else { txtBirthday.Text = "1980-01-01"; this.Title = "会员编辑"; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { //判断是否存在用户名及验证码是否正确 if (Session["SiteCheckCode"] == null) { MojoCube.Api.UI.Script.ScriptMessage(this, "请填写验证码"); return; } if (Session["SiteCheckCode"] != null && Session["SiteCheckCode"].ToString().ToLower() != txtCode.Text.Trim().ToLower()) { MojoCube.Api.UI.Script.ScriptMessage(this, "验证码错误"); return; } MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); if (user.ChkUser(txtPhone.Text.Trim(), txtEmail.Text.Trim())) { user.GetData(txtPhone.Text.Trim()); if (user.IsCheck) { string password = Guid.NewGuid().ToString().Substring(0, 6); user.UpdateMember_UserPass(user.pk_Member, FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower()); SendMail(user.Email, user.FirstName, user.LastName, user.UserName, password); MojoCube.Api.UI.Script.ScriptMessage(this, "新密码已经发到您的邮箱,请查收邮箱!"); } else { MojoCube.Api.UI.Script.ScriptMessage(this, "该用户尚未激活账号!"); } txtPhone.Text = ""; txtEmail.Text = ""; txtCode.Text = ""; btnSubmit.Enabled = false; } else { MojoCube.Api.UI.Script.ScriptMessage(this, "错误的手机号或邮箱"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MojoCube.Web.Member.List member = new MojoCube.Web.Member.List(); member.GetData(int.Parse(Session["Member_UserID"].ToString())); txtContactName.Text = member.LastName + member.FirstName; txtAddress.Text = member.Address; txtContactPhone.Text = member.Phone1; ViewState["Email"] = member.Email; GridBind(); WUC_MemberMenu.CssFocus = "id=\"\""; BannerDiv.InnerHtml = MojoCube.Web.Site.Cache.GetSiteBanner(strLanguage, 1); this.Title = MojoCube.Web.String.GetTitle(hlTitle.Text, MojoCube.Web.Site.Cache.GetSiteTitle(strLanguage)); lblTotal.Text = MojoCube.Web.String.GetCurrency(total); ViewState["Total"] = total; hlProduct.NavigateUrl = MojoCube.Web.Site.Cache.GetUrlExtension("Product", strLanguage); hlOrder.NavigateUrl = MojoCube.Web.Site.Cache.GetUrlExtension("Order", strLanguage); } }
private string CreateInfo() { StringBuilder sb = new StringBuilder(); MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); user.GetData(int.Parse(Session["Member_UserID"].ToString())); string img = "Admin/Images/user.png"; if (user.ImagePath != "") { img = "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(user.ImagePath); } int msgCount = MojoCube.Web.Sql.GetResultCount("Member_Message", "ReceiveUserID=" + Session["Member_UserID"].ToString() + " and IsDeleted=0 and IsRead=0"); sb.Append("<div style=\"text-align:left; background:#eee; padding:10px;\">"); sb.Append("<a href=\"" + MojoCube.Web.Site.Cache.GetUrlExtension("Setting", strLanguage) + "\"><img src=\"" + img + "\" class=\"toppic\" /> " + user.LastName + user.FirstName + "(" + user.Phone1 + ")</a>"); if (msgCount > 0) { sb.Append("您有<a href=\"" + MojoCube.Web.Site.Cache.GetUrlExtension("Message", strLanguage) + "\"><b class=\"price\"> " + msgCount + " </b></a>条新的消息,请到消息中心查看。"); } sb.Append("</div>"); string orderUrl = MojoCube.Web.Site.Cache.GetUrlExtension("Order", strLanguage); sb.Append("<table style=\"width:100%;\">"); sb.Append("<tr>"); sb.Append("<td style=\"border-right:solid 1px #ddd; text-align:center; padding:10px;\"><a href=\"" + orderUrl + "?status=0\">待付款" + GetOrderStatus(0) + "</a></td>"); sb.Append("<td style=\"border-right:solid 1px #ddd; text-align:center; padding:10px;\"><a href=\"" + orderUrl + "?status=1\">待发货" + GetOrderStatus(1) + "</a></td>"); sb.Append("<td style=\"border-right:solid 1px #ddd; text-align:center; padding:10px;\"><a href=\"" + orderUrl + "?status=2\">待收货" + GetOrderStatus(2) + "</a></td>"); sb.Append("<td style=\"text-align:center; padding:10px;\"><a href=\"" + orderUrl + "?status=3\">待评价" + GetOrderStatus(3) + "</a></td>"); sb.Append("</tr>"); sb.Append("</table>"); return(sb.ToString()); }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtPhone.Text == "" || txtName.Text == "" || txtEmail.Text == "" || txtPassword.Text.Trim() == "") { MojoCube.Api.UI.Script.ScriptMessage(this, "请填写完整"); return; } if (!RegexPhone(txtPhone.Text.Trim())) { MojoCube.Api.UI.Script.ScriptMessage(this, "请输入正确的手机号"); return; } if (txtPassword1.Text.Trim() != "" && txtPassword1.Text.Trim().Length < 6) { MojoCube.Api.UI.Script.ScriptMessage(this, "请输入至少6位密码"); return; } if (txtPassword1.Text.Trim() != txtPassword2.Text.Trim()) { MojoCube.Api.UI.Script.ScriptMessage(this, "两次密码不一致"); return; } MojoCube.Web.Member.List list = new MojoCube.Web.Member.List(); list.GetData(int.Parse(Session["Member_UserID"].ToString())); if (list.ChkUserName(txtPhone.Text.Trim()) && list.Phone1 != txtPhone.Text.Trim()) { MojoCube.Api.UI.Script.ScriptMessage(this, "手机号已存在!"); return; } if (list.ChkUserEmail(txtEmail.Text.Trim()) && list.Email != txtEmail.Text.Trim()) { MojoCube.Api.UI.Script.ScriptMessage(this, "邮件已存在!"); return; } if (list.IsUser(txtPhone.Text.Trim(), FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "MD5").ToLower().Trim()) && !list.IsLock) { list.UserName = txtPhone.Text.Trim(); list.Address = txtAddress.Text.Trim(); list.FirstName = MojoCube.Web.String.GetChineseName(txtName.Text.Trim(), false); list.LastName = MojoCube.Web.String.GetChineseName(txtName.Text.Trim(), true); list.Phone1 = txtPhone.Text.Trim(); list.Email = txtEmail.Text.Trim(); if (txtPassword1.Text.Trim() != "") { list.UserPass = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword1.Text.Trim(), "MD5").ToLower(); } MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Member/" + list.pk_Member; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuPortrait); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; Session["Member_UserImagePath"] = list.ImagePath; imgPortrait.ImageUrl = "Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(Session["Member_UserImagePath"].ToString()); } list.UpdateData(list.pk_Member); MojoCube.Api.UI.Script.ScriptMessage(this, "修改成功!"); } else { MojoCube.Api.UI.Script.ScriptMessage(this, "密码错误!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (txtName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写用户名"); return; } MojoCube.Web.Member.List list = new MojoCube.Web.Member.List(); //修改 if (ViewState["pk_Member"] != null) { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Member/" + ViewState["pk_Member"].ToString(); upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuPortrait); list.GetData(int.Parse(ViewState["pk_Member"].ToString())); if (cbResetPsw.Checked) { list.UserPass = FormsAuthentication.HashPasswordForStoringInConfigFile("123456", "MD5").ToLower(); } list.UserName = txtName.Text.Trim(); list.FirstName = txtFirstName.Text.Trim(); list.LastName = txtLastName.Text.Trim(); list.Phone1 = txtPhone.Text.Trim(); list.Mobile = txtPhone.Text.Trim(); list.Email = txtEmail.Text.Trim(); list.Address = txtAddress.Text.Trim(); list.Birthday = txtBirthday.Text.Trim() + " 00:00:00"; list.Sex = int.Parse(ddlSex.SelectedValue); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; } list.UpdateData(list.pk_Member); } //新增 else { list.UserName = txtPhone.Text.Trim(); list.UserPass = FormsAuthentication.HashPasswordForStoringInConfigFile("123456", "MD5").ToLower(); list.NickName = string.Empty; list.FirstName = txtFirstName.Text.Trim(); list.LastName = txtLastName.Text.Trim(); list.Sex = int.Parse(ddlSex.SelectedValue); list.Phone1 = txtPhone.Text.Trim(); list.Phone2 = string.Empty; list.Mobile = txtPhone.Text.Trim(); list.Fax = string.Empty; list.Country = string.Empty; list.CountryID = 0; list.Province = string.Empty; list.ProvinceID = 0; list.City = string.Empty; list.CityID = 0; list.Zip = string.Empty; list.Address = txtAddress.Text.Trim(); list.Powers = string.Empty; list.Remark = string.Empty; list.Email = txtEmail.Text.Trim(); list.IsLock = false; list.LastLogin = DateTime.Now.ToString(); list.LastLoginIP = string.Empty; list.LoginTimes = 0; list.ImagePath = string.Empty; list.CreateDate = DateTime.Now.ToString(); list.TypeID = 0; list.IsCheck = true; list.CheckDate = DateTime.Now.ToString(); list.CheckCode = Guid.NewGuid().ToString(); list.AboutMe = string.Empty; list.Clicks = 0; list.IsReceiveNews = false; list.IsPublic = false; list.IsLockBlog = false; list.Following = string.Empty; list.Followers = string.Empty; list.Question = string.Empty; list.Answer = string.Empty; list.Birthday = txtBirthday.Text.Trim() + " 00:00:00"; list.InsertData(); } Response.Redirect("List.aspx?active=" + Request.QueryString["active"]); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtTitle.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写标题"); return; } MojoCube.Web.Member.Mail mail = new MojoCube.Web.Member.Mail(); //修改 if (ViewState["pk_Mail"] != null) { mail.GetData(int.Parse(ViewState["pk_Mail"].ToString())); mail.Subject = txtTitle.Text.Trim(); mail.Contents = txtDescription.Text.Trim(); mail.UpdateData(mail.pk_Mail); AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); } //新增 else { mail.fk_Account = 0; mail.fk_Template = 0; mail.CC = string.Empty; mail.Bcc = string.Empty; mail.Subject = txtTitle.Text.Trim(); mail.Contents = txtDescription.Text.Trim(); mail.StatusID = 0; mail.CreateDate = DateTime.Now.ToString(); mail.CreateUserID = int.Parse(Session["UserID"].ToString()); if (cblReceive.Items[0].Value == "0") { DataTable dt = MojoCube.Web.Sql.SqlQueryDS("select * from Member_List where IsLock=0 and IsCheck=1").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { mail.TypeID = 0; mail.fk_Member = int.Parse(dt.Rows[i]["pk_Member"].ToString()); mail.Email = dt.Rows[i]["Email"].ToString(); mail.ReceiveName = dt.Rows[i]["UserName"].ToString(); mail.IsSend = SendMail(dt.Rows[i]["Email"].ToString(), dt.Rows[i]["FirstName"].ToString(), dt.Rows[i]["LastName"].ToString(), dt.Rows[i]["UserName"].ToString()); mail.InsertData(); } } } else { for (int i = 0; i < cblReceive.Items.Count; i++) { if (cblReceive.Items[i].Selected == true) { mail.TypeID = 1; mail.fk_Member = int.Parse(cblReceive.Items[i].Value); MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); user.GetData(mail.fk_Member); mail.Email = user.Email; mail.ReceiveName = cblReceive.Items[i].Text; mail.IsSend = SendMail(user.Email, user.FirstName, user.LastName, user.UserName); mail.InsertData(); } } } AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "邮件发送成功"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hlBack.NavigateUrl = "Mail.aspx?active=" + Request.QueryString["active"]; if (Request.QueryString["id"] != null) { ViewState["pk_Mail"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]); MojoCube.Web.Member.Mail mail = new MojoCube.Web.Member.Mail(); mail.GetData(int.Parse(ViewState["pk_Mail"].ToString())); txtTitle.Text = mail.Subject; txtDescription.Text = mail.Contents; MojoCube.Web.Member.List user = new MojoCube.Web.Member.List(); user.GetData(mail.fk_Member); cblReceive.Items.Add(new ListItem(" " + user.UserName, user.pk_Member.ToString())); cblReceive.Items[0].Selected = true; cblReceive.Items[0].Enabled = false; this.Title = "邮件编辑:" + txtTitle.Text.Trim(); } else { if (Request.QueryString["uid"] != null) { string uid = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["uid"]); DataTable dt = MojoCube.Web.Sql.SqlQueryDS("select * from Member_List where IsLock=0 and IsCheck=1 and pk_Member in (" + uid + ")").Tables[0]; cblReceive.DataSource = dt; cblReceive.DataBind(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { cblReceive.Items[i].Text = dt.Rows[i]["UserName"].ToString(); cblReceive.Items[i].Value = dt.Rows[i]["pk_Member"].ToString(); cblReceive.Items[i].Selected = true; } } } else { cblReceive.Items.Add(new ListItem(" 所有会员", "0")); cblReceive.Items[0].Selected = true; cblReceive.Items[0].Enabled = false; } MojoCube.Web.Mail.Account account = new MojoCube.Web.Mail.Account(); account.GetDataTypeID(3); MojoCube.Web.Mail.Template template = new MojoCube.Web.Mail.Template(); template.GetDataAccountID(account.pk_Account); txtTitle.Text = template.Subject; txtDescription.Text = template.Description; this.Title = "邮件编辑"; } } }