//上传水印 private string GetWM() { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Site/Watermark"; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuWM); if (upload.IsUpload) { imgWM.Visible = true; imgWM.ImageUrl = "~/Files.aspx?image=" + MojoCube.Api.Text.Security.EncryptString(upload.OldFilePath) + "&w=400&h=300"; return(upload.OldFilePath); } else { imgWM.Visible = false; return(string.Empty); } }
protected void btnSave_Click(object sender, EventArgs e) { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Image"; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuImage); if (upload.IsUpload) { MojoCube.Web.Image.List list = new MojoCube.Web.Image.List(); list.fk_Category = int.Parse(ddlCategory2.SelectedValue); list.FileName = upload.OldFileName; list.FilePath = upload.OldFilePath; list.FileType = upload.FileType; list.FileSize = upload.FileSize; list.Width = 0; list.Height = 0; if (upload.IsImage()) { System.Drawing.Image image = System.Drawing.Image.FromStream(fuImage.PostedFile.InputStream); list.Width = image.Width; list.Height = image.Height; } list.Title = txtTitle.Text.Trim(); list.CreateDate = DateTime.Now.ToString(); list.CreateUserID = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = 0; list.Language = MojoCube.Api.UI.Language.GetLanguage(); list.InsertData(); GridBind(); } }
protected void btnUpload_Click(object sender, EventArgs e) { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Album/" + txtPageName.Text.Trim(); upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuImageUpload); if (upload.IsUpload) { MojoCube.Web.Album.Image image = new MojoCube.Web.Album.Image(); image.fk_Album = int.Parse(ViewState["pk_Album"].ToString()); image.FileName = upload.OldFileName; image.FilePath = upload.OldFilePath; image.FileType = upload.FileType; image.FileSize = upload.FileSize; image.Width = 0; image.Height = 0; if (upload.IsImage()) { System.Drawing.Image draw = System.Drawing.Image.FromStream(fuImageUpload.PostedFile.InputStream); image.Width = draw.Width; image.Height = draw.Height; } image.Title = txtImageTitle.Text.Trim(); image.SortID = MojoCube.Web.String.ToInt(txtImageSort.Text.Trim()); image.Visible = true; image.CreateDate = DateTime.Now.ToString(); image.CreateUserID = int.Parse(Session["UserID"].ToString()); image.ModifyDate = DateTime.Now.ToString(); image.ModifyUserID = 0; image.Language = MojoCube.Api.UI.Language.GetLanguage(); image.InsertData(); ImageBind(); AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (txtTitle.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写标题"); return; } MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Album/" + txtPageName.Text.Trim(); upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuImage); MojoCube.Web.Album.List list = new MojoCube.Web.Album.List(); //修改 if (ViewState["pk_Album"] != null) { list.GetData(int.Parse(ViewState["pk_Album"].ToString())); MojoCube.Web.Album.Category category = new MojoCube.Web.Album.Category(); category.GetData(int.Parse(ddlCategory.SelectedValue)); if (category.ParentID == 0) { list.CategoryID1 = category.pk_Category; list.CategoryID2 = 0; } else { list.CategoryID1 = category.ParentID; list.CategoryID2 = category.pk_Category; } list.Title = txtTitle.Text.Trim(); list.PageName = txtPageName.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.Description = txtDescription.Text.Trim(); list.Issue = cbIssue.Checked; list.SEO_Title = txtSEO_Title.Text.Trim(); list.SEO_Keyword = txtSEO_Keyword.Text.Trim(); list.SEO_Description = txtSEO_Description.Text.Trim(); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = int.Parse(Session["UserID"].ToString()); list.UpdateData(list.pk_Album); } //新增 else { MojoCube.Web.Album.Category category = new MojoCube.Web.Album.Category(); category.GetData(int.Parse(ddlCategory.SelectedValue)); if (category.ParentID == 0) { list.CategoryID1 = category.pk_Category; list.CategoryID2 = 0; } else { list.CategoryID1 = category.ParentID; list.CategoryID2 = category.pk_Category; } list.PageName = txtPageName.Text.Trim(); list.Title = txtTitle.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.Description = txtDescription.Text.Trim(); if (txtSEO_Title.Text.Trim() != "") { list.SEO_Title = txtSEO_Title.Text.Trim(); } else { list.SEO_Title = txtTitle.Text.Trim(); } list.SEO_Keyword = txtSEO_Keyword.Text.Trim(); list.SEO_Description = txtSEO_Description.Text.Trim(); list.Tags = string.Empty; list.Visual = string.Empty; if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } else { list.ImagePath = string.Empty; } list.Issue = cbIssue.Checked; list.IsComment = false; list.IsRecommend = false; list.Clicks = 0; list.SortID = 0; list.TypeID = 0; list.Score = 0; list.ScoreIn = 0; list.StartDate = DateTime.Now.ToString(); list.EndDate = DateTime.Now.ToString(); list.CreateDate = DateTime.Now.ToString(); list.CreateUserID = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = 0; list.Language = MojoCube.Api.UI.Language.GetLanguage(); ViewState["pk_Album"] = list.InsertData(); } ImageBind(); AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); }
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 (txtTitle.Text.Trim() == "" || txtPageName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写标题和页面名称"); return; } MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Content"; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuImage); MojoCube.Web.Content.List list = new MojoCube.Web.Content.List(); //修改 if (ViewState["pk_Content"] != null) { list.GetData(int.Parse(ViewState["pk_Content"].ToString())); list.PageName = txtPageName.Text.Trim(); list.Title = txtTitle.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.Description = txtDescription.Text.Trim(); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } list.Visible = cbVisible.Checked; list.SEO_Title = txtSEO_Title.Text.Trim(); list.SEO_Keyword = txtSEO_Keyword.Text.Trim(); list.SEO_Description = txtSEO_Description.Text.Trim(); list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = int.Parse(Session["UserID"].ToString()); list.UpdateData(list.pk_Content); } //新增 else { list.PageName = txtPageName.Text.Trim(); list.Title = txtTitle.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.Description = txtDescription.Text.Trim(); list.Visible = cbVisible.Checked; if (txtSEO_Title.Text.Trim() != "") { list.SEO_Title = txtSEO_Title.Text.Trim(); } else { list.SEO_Title = txtTitle.Text.Trim(); } list.SEO_Keyword = txtSEO_Keyword.Text.Trim(); list.SEO_Description = txtSEO_Description.Text.Trim(); list.Clicks = 0; if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } else { list.ImagePath = string.Empty; } list.CreateDate = DateTime.Now.ToString(); list.CreateUserID = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = 0; list.Language = MojoCube.Api.UI.Language.GetLanguage(); ViewState["pk_Content"] = list.InsertData(); } AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtTitle.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写标题"); return; } MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Payment"; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuImage); MojoCube.Web.Payment.List list = new MojoCube.Web.Payment.List(); //修改 if (ViewState["pk_Payment"] != null) { list.GetData(int.Parse(ViewState["pk_Payment"].ToString())); list.Title = txtTitle.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.TypeID = int.Parse(ddlType.SelectedValue); list.Gateway = txtGateway.Text.Trim(); list.Service = txtService.Text.Trim(); list.Account = txtAccount.Text.Trim(); list.AppID = txtAppID.Text.Trim(); list.Secret = txtSecret.Text.Trim(); list.PartnerID = txtPartnerID.Text.Trim(); list.KeyCode = txtKeyCode.Text.Trim(); list.SignType = txtSignType.Text.Trim(); list.InputCharset = txtInputCharset.Text.Trim(); list.Currency = txtCurrency.Text.Trim(); list.Rate = MojoCube.Web.String.ToDecimal(txtRate.Text.Trim()); list.Visible = cbVisible.Checked; list.SortID = MojoCube.Web.String.ToInt(txtSortID.Text.Trim()); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = int.Parse(Session["UserID"].ToString()); list.UpdateData(list.pk_Payment); } //新增 else { list.Title = txtTitle.Text.Trim(); list.Subtitle = txtSubtitle.Text.Trim(); list.TypeID = int.Parse(ddlType.SelectedValue); list.Gateway = txtGateway.Text.Trim(); list.Service = txtService.Text.Trim(); list.Account = txtAccount.Text.Trim(); list.AppID = txtAppID.Text.Trim(); list.Secret = txtSecret.Text.Trim(); list.PartnerID = txtPartnerID.Text.Trim(); list.KeyCode = txtKeyCode.Text.Trim(); list.SignType = txtSignType.Text.Trim(); list.InputCharset = txtInputCharset.Text.Trim(); list.Description = string.Empty; list.Currency = txtCurrency.Text.Trim(); list.Rate = MojoCube.Web.String.ToDecimal(txtRate.Text.Trim()); list.Visible = cbVisible.Checked; list.SortID = MojoCube.Web.String.ToInt(txtSortID.Text.Trim()); if (upload.IsUpload) { list.ImagePath = upload.OldFilePath; SetImage(list.ImagePath); } else { list.ImagePath = string.Empty; } list.CreateDate = DateTime.Now.ToString(); list.CreateUserID = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.ModifyUserID = 0; ViewState["pk_Payment"] = list.InsertData(); } AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写名称"); return; } MojoCube.Web.User.List list = new MojoCube.Web.User.List(); //修改 if (ViewState["pk_User"] != null) { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "User/" + ViewState["pk_User"].ToString(); upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuPortrait); list.GetData(int.Parse(ViewState["pk_User"].ToString())); if (cbResetPsw.Checked) { list.Password = FormsAuthentication.HashPasswordForStoringInConfigFile("123456", "MD5").ToLower(); } list.fk_Department = int.Parse(ddlDepartment.SelectedValue); list.RoleValue = int.Parse(ddlRole.SelectedValue); list.RoleList = ddlRole.SelectedValue; list.Position = int.Parse(ddlPosition.SelectedValue); list.UserName = txtName.Text.Trim(); list.NickName = txtNickName.Text.Trim(); list.FullName = txtFullName.Text.Trim(); list.FirstName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), false); list.LastName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), true); list.Phone1 = txtPhone1.Text.Trim(); list.Email1 = txtEmail1.Text.Trim(); list.Address1 = txtAddress1.Text.Trim(); list.Birthday = txtBirthday.Text.Trim(); list.Education = txtEducation.Text.Trim(); list.School = txtSchool.Text.Trim(); list.BankAccount = txtBankAccount.Text.Trim(); list.IDNumber = txtIDNumber.Text.Trim(); list.Wages = MojoCube.Web.String.ToDecimal(txtWages.Text.Trim()); list.EntryTime = txtEntryTime.Text.Trim(); list.Skin = ddlSkin.SelectedValue; list.Sex = int.Parse(ddlSex.SelectedValue); if (upload.IsUpload) { list.ImagePath1 = upload.OldFilePath; } list.ModifyUser = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.UpdateData(list.pk_User); } //新增 else { list.UserName = txtName.Text.Trim(); list.Password = FormsAuthentication.HashPasswordForStoringInConfigFile("123456", "MD5").ToLower(); list.TypeID = 0; list.fk_Department = int.Parse(ddlDepartment.SelectedValue); list.RoleValue = int.Parse(ddlRole.SelectedValue); list.RoleList = ddlRole.SelectedValue; list.Position = int.Parse(ddlPosition.SelectedValue); list.Number = string.Empty; list.Skin = ddlSkin.SelectedValue; list.Language = "CHS"; list.IsLock = false; list.LastLoginIP = string.Empty; list.LastLoginTime = DateTime.Now.ToString(); list.NickName = txtNickName.Text.Trim(); list.FullName = txtFullName.Text.Trim(); list.FirstName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), false); list.MiddleName = string.Empty; list.LastName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), true); list.Phone1 = txtPhone1.Text.Trim(); list.Phone2 = string.Empty; list.Email1 = txtEmail1.Text.Trim(); list.Email2 = string.Empty; list.Fax = string.Empty; list.Line = string.Empty; list.Wechat = string.Empty; list.QQ = string.Empty; list.Facebook = string.Empty; list.Twitter = string.Empty; list.Linkedin = string.Empty; list.ZipCode = string.Empty; list.Place = string.Empty; list.Address1 = txtAddress1.Text.Trim(); list.Address2 = string.Empty; list.Province = 0; list.City = 0; list.County = 0; list.Zone = 0; list.Sex = int.Parse(ddlSex.SelectedValue); list.Height = 0; list.Weight = 0; list.Birthday = txtBirthday.Text.Trim(); list.Education = txtEducation.Text.Trim(); list.School = txtSchool.Text.Trim(); list.ImagePath1 = string.Empty; list.ImagePath2 = string.Empty; list.IDCardPath = string.Empty; list.ResumePath = string.Empty; list.Wages = MojoCube.Web.String.ToDecimal(txtWages.Text.Trim()); list.BankAccount = txtBankAccount.Text.Trim(); list.IDNumber = txtIDNumber.Text.Trim(); list.Source = string.Empty; list.Note = string.Empty; list.Remark = string.Empty; list.EntryTime = txtEntryTime.Text.Trim(); list.IsQuit = false; list.QuitTime = DateTime.Now.ToString(); list.fk_Company = 0; list.CreateUser = int.Parse(Session["UserID"].ToString()); list.CreateDate = DateTime.Now.ToString(); list.ModifyUser = 0; list.ModifyDate = DateTime.Now.ToString(); 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.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "Site/Banner"; upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuBanner); MojoCube.Web.Site.Banner banner = new MojoCube.Web.Site.Banner(); //修改 if (ViewState["pk_Banner"] != null) { banner.GetData(int.Parse(ViewState["pk_Banner"].ToString())); banner.Title = txtTitle.Text.Trim(); banner.Description = txtDescription.Text.Trim(); banner.Url = txtUrl.Text.Trim(); banner.TypeID = int.Parse(ddlType.SelectedValue); banner.SortID = MojoCube.Web.String.ToInt(txtSortID.Text.Trim()); banner.Visible = cbVisible.Checked; banner.ModifyDate = DateTime.Now.ToString(); banner.ModifyUserID = int.Parse(Session["UserID"].ToString()); if (upload.IsUpload) { banner.FileName = upload.OldFileName; banner.FilePath = upload.OldFilePath; banner.FileType = upload.FileType; banner.FileSize = upload.FileSize; if (upload.IsImage()) { System.Drawing.Image image = System.Drawing.Image.FromStream(fuBanner.PostedFile.InputStream); banner.Width = image.Width; banner.Height = image.Height; } SetImage(banner.FilePath); } banner.UpdateData(banner.pk_Banner); } //新增 else { banner.Title = txtTitle.Text.Trim(); banner.Description = txtDescription.Text.Trim(); banner.Url = txtUrl.Text.Trim(); banner.Target = "_blank"; banner.TypeID = int.Parse(ddlType.SelectedValue); if (upload.IsUpload) { banner.FileName = upload.OldFileName; banner.FilePath = upload.OldFilePath; banner.FileType = upload.FileType; banner.FileSize = upload.FileSize; if (upload.IsImage()) { System.Drawing.Image image = System.Drawing.Image.FromStream(fuBanner.PostedFile.InputStream); banner.Width = image.Width; banner.Height = image.Height; } SetImage(banner.FilePath); } else { banner.FileName = string.Empty; banner.FilePath = string.Empty; banner.FileType = string.Empty; banner.FileSize = 0; banner.Width = 0; banner.Height = 0; } banner.SortID = MojoCube.Web.String.ToInt(txtSortID.Text.Trim()); banner.Visible = cbVisible.Checked; banner.CreateDate = DateTime.Now.ToString(); banner.CreateUserID = int.Parse(Session["UserID"].ToString()); banner.ModifyDate = DateTime.Now.ToString(); banner.ModifyUserID = 0; banner.Language = MojoCube.Api.UI.Language.GetLanguage(); ViewState["pk_Banner"] = banner.InsertData(); } AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("success", "数据保存成功"); }
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 (txtFullName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写真实姓名"); return; } MojoCube.Web.User.List list = new MojoCube.Web.User.List(); //修改 if (Session["UserID"] != null) { MojoCube.Api.File.Upload upload = new MojoCube.Api.File.Upload(); upload.FilePath = "User/" + Session["UserID"].ToString(); upload.FileName = MojoCube.Api.Text.Function.DateTimeString(true); upload.DoFileUpload(fuPortrait); list.GetData(int.Parse(Session["UserID"].ToString())); if (txtPassword1.Text.Trim() != "") { if (txtPassword1.Text.Trim().Length < 6) { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请输入至少6位密码"); return; } if (txtPassword1.Text.Trim() != txtPassword2.Text.Trim()) { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "两次输入密码不一致"); return; } list.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword1.Text.Trim(), "MD5").ToLower(); } list.UserName = txtName.Text.Trim(); list.NickName = txtNickName.Text.Trim(); list.FullName = txtFullName.Text.Trim(); list.FirstName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), false); list.LastName = MojoCube.Web.String.GetChineseName(txtFullName.Text.Trim(), true); list.Phone1 = txtPhone1.Text.Trim(); list.Email1 = txtEmail1.Text.Trim(); list.Address1 = txtAddress1.Text.Trim(); list.Education = txtEducation.Text.Trim(); list.School = txtSchool.Text.Trim(); list.BankAccount = txtBankAccount.Text.Trim(); list.IDNumber = txtIDNumber.Text.Trim(); list.Skin = ddlSkin.SelectedValue; list.Sex = int.Parse(ddlSex.SelectedValue); list.Birthday = txtBirthday.Text.Trim(); list.Note = txtNote.Text.Trim(); if (upload.IsUpload) { list.ImagePath1 = upload.OldFilePath; } list.ModifyUser = int.Parse(Session["UserID"].ToString()); list.ModifyDate = DateTime.Now.ToString(); list.UpdateData(list.pk_User); Response.Redirect("Profile.aspx"); } }