Ejemplo n.º 1
0
 public Result Add(AddMemberInput input)
 {
     #region 处理密码
     var key = UserHelper.GenUserSecretkey();
     var pwd = PasswordHelper.Encrypt(input.Password, key);
     input.Password  = pwd;
     input.Secretkey = key;
     input.Name      = CNName.GetRandomName();
     input.Mobile    = CNMobile.GetRandomMobNO();
     #endregion
     var model = _entityService.AddDto <MemberEntity, AddMemberInput>(input);
     return(model);
 }
Ejemplo n.º 2
0
 public Result Add(UsersInput input)
 {
     #region 处理密码 随机生产信息
     var key = UserHelper.GenUserSecretkey();
     var pwd = PasswordHelper.Encrypt(input.Password, key);
     input.Password  = pwd;
     input.Secretkey = key;
     input.UserName  = CNName.GetRandomString();
     input.Gender    = (DateTime.Now.Second % 2 == 0) ? Core.Entities.Enum.Gender.女 : ((DateTime.Now.Second % 3 == 0)?Core.Entities.Enum.Gender.男: Core.Entities.Enum.Gender.保密);
     input.Mobile    = CNMobile.GetRandomMobNO();
     input.Birthday  = CNName.GetRandomDateTime();
     #endregion
     var model = _entityService.AddDto <UsersEntity, UsersInput>(input);
     return(model);
 }