/// <summary> /// 根据用户id得到用户的邮箱 /// </summary> /// <param name="userID"></param> /// <returns></returns> protected string EmailSuffix(string sUserID) { int userID = Globals.SafeInt(Globals.UrlDecode(sUserID), 0); BLL.Members.Users bll = new BLL.Members.Users(); Model.Members.Users model = bll.GetModel(userID); if (model != null) { return(model.Email); } else { return(""); } }
public override bool LoadUserInfo(int UserID) { if ((this.UserModel = UserExBll.GetUsersExpModel(UserID)) != null) { this.UserID = UserID; this.DefaultPostType = Model.SNS.EnumHelper.PostType.User; this.IsCurrentUser = false; #region 后期需要优化这部分,用户扩展表中取不到NickName YSWL.MALL.BLL.Members.Users UserBll = new BLL.Members.Users(); YSWL.MALL.Model.Members.Users model = new Model.Members.Users(); model = UserBll.GetModel(UserID); this.NickName = model != null ? model.NickName : ""; this.Activity = model != null ? model.Activity.Value:false; #endregion return(true); } return(false); }
public void btnSave_Click(object sender, System.EventArgs e) { if (lbEnterPid.Text.Trim() != "") { EnterPriseModel = EnterpriseBll.GetModel(int.Parse(lbEnterPid.Text)); userModel = userbll.GetModel(EnterPriseModel.UserName); } User newUser = new User(); #pragma warning disable CS0219 // 变量“strErr”已被赋值,但从未使用过它的值 string strErr = ""; #pragma warning restore CS0219 // 变量“strErr”已被赋值,但从未使用过它的值 //if (newUser.HasUserByUserName(txtUserName.Text)) //{ // strErr += Resources.Site.TooltipUserExist; //} //if (strErr != "") //{ // YSWL.Common.MessageBox.ShowSuccessTip(this, strErr); // return; //} newUser.UserName = txtUserName.Text; newUser.Password = AccountsPrincipal.EncryptPassword("111111"); newUser.NickName = newUser.UserName; //昵称和用户名相同 SNS模块使用 newUser.TrueName = txtName.Text; newUser.Sex = "1"; newUser.EmployeeID = 0; newUser.Activity = true; newUser.UserType = "EE"; newUser.Style = 1; newUser.User_dateCreate = DateTime.Now; newUser.User_iCreator = CurrentUser.UserID; newUser.User_dateValid = DateTime.Now; newUser.User_cLang = "zh-CN"; EnterPriseModel.UserName = txtUserName.Text; EnterPriseModel.Name = txtName.Text; EnterPriseModel.SimpleName = txtSimpleName.Text; EnterPriseModel.Status = 0; EnterPriseModel.EnterpriseNum = txtEnterpriseNum.Text; EnterPriseModel.BusinessLicense = txtBusinessLicense.Text; EnterPriseModel.TelPhone = txtTelPhone.Text; EnterPriseModel.CellPhone = txtCellPhone.Text; EnterPriseModel.AccountBank = txtAccountBank.Text; EnterPriseModel.AccountInfo = txtAccountInfo.Text; EnterPriseModel.AccountNum = txtAccountNum.Text; EnterPriseModel.WithdrawBank = txtWithdrawBank.Text; EnterPriseModel.WithdrawInfo = txtWithdrawInfo.Text; EnterPriseModel.WithdrawNum = txtWithdrawNum.Text; EnterPriseModel.Balance = 0; EnterPriseModel.AppId = txtAppId.Text; EnterPriseModel.AppSecrit = txtAppSecrit.Text; EnterPriseModel.AppUrl = txtAppUrl.Text; EnterPriseModel.AppReturnUrl = txtAppReturnUrl.Text; EnterPriseModel.ContactMail = txtContactMail.Text; EnterPriseModel.Address = txtAddress.Text; EnterPriseModel.EnteRank = 1; EnterPriseModel.CreatedDate = DateTime.Now; EnterPriseModel.CreatedUserID = CurrentUser.UserID; EnterPriseModel.RegisterIp = ""; EnterPriseModel.Remark = txtRemark.Text; EnterPriseModel.AgentId = int.Parse(lbAgentId.Text); if (lbEnterPid.Text == "") { if (EnterpriseBll.ExistsUsername(txtUserName.Text)) { lblMsg.Text = "用户名已存在,请重新输入!"; return; } if (EnterpriseBll.ExistsName(txtName.Text)) { lblMsg.Text = "商户名称已存在,请重新输入!"; return; } else { int userid = newUser.Create(); if (userid == -100) { //ERROR YSWL.Common.MessageBox.ShowSuccessTip(this, Resources.Site.TooltipUserExist); return; } //新增商户成功 if (EnterpriseBll.Add(EnterPriseModel) > 0) { YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("新增商户:【{0}】成功!", txtUserName.Text)); LogHelp.AddUserLog(CurrentUser.UserName, CurrentUser.UserType, string.Format("新增商户:【{0}】", txtUserName.Text), this); Response.Redirect("EnterpriseList.aspx"); } } } else { if (EnterpriseBll.ExistsUsername(lbEnterPid.Text, txtUserName.Text)) { lblMsg.Text = "用户名已存在,请重新输入!"; } if (EnterpriseBll.ExistsName(lbEnterPid.Text, txtName.Text)) { lblMsg.Text = "商户名称已存在,请重新输入!"; return; } else { userModel.UserName = txtUserName.Text; EnterpriseBll.Update(EnterPriseModel);//修改企业信息 YSWL.Common.MessageBox.ShowSuccessTip(this, string.Format("修改商户信息:【{0}】成功!", txtUserName.Text)); Response.Redirect("EnterpriseList.aspx"); } } }