internal static UserBindEntity ToUserBindEntity(BzjUserBindEntity entity)
 {
     UserBindEntity uEntity = new UserBindEntity();
     uEntity.CreateDate = entity.CreateDate;
     uEntity.UserId = entity.UserId;
     uEntity.IsEnable = entity.IsEnable;
     uEntity.JUserId = entity.JUserId;
     uEntity.UserBindId = entity.UserBindId;
     return uEntity;
 }
 /// <summary>
 /// 金生金用户绑定
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public ErrType CreateAdminGssUser(BzjUserBindEntity bzjentity, string loginID, string userID, int roleType)
 {
     try
     {
         UserBindEntity entity = MyConverter.ToUserBindEntity(bzjentity);
         ResultDesc result = _IManagerBzj.CreateAdminGssUser(entity, loginID, roleType);
         return result.Result ? GeneralErr.Success : new ErrType(ERR.SERVICE, result.Desc);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message + ex.StackTrace);
         return null;
     }
 }
        /// <summary>
        /// 激活金生金账户
        /// </summary>
        public void ActivateJgj(ClientAccount client)
        {
            //验证是否已激活金生金账户
            int exist = _bzjService.JgjIsUserExist(1, client.AccInfo.CertificateNumber);
            if (exist == 0)
            {
                string tip;//提示信息
                //随机生成的密码
                string pwd = new Random().Next(100000, 999999).ToString();
                string returnResult = _bzjService.JgjUserRegister((int)client.AccInfo.CeritificateEnum, client.AccInfo.CertificateNumber, pwd,
                    client.AccInfo.Dealer, (int)client.AccInfo.ClientType, client.AccInfo.UserName, client.AccInfo.CellPhoneNumber);

                if (returnResult == "1000")
                {
                    tip = "用户已经存在";
                }
                else if (returnResult == "2000")
                {
                    tip = "系统错误";
                }
                else
                {
                    tip = "金生金账户激活成功";
                    BzjUserBindEntity bzjentity = new BzjUserBindEntity();
                    bzjentity.UserId = client.AccInfo.UserID;
                    bzjentity.JUserId = returnResult;
                    ErrType errJgs = _bzjService.CreateAdminGssUser(bzjentity, _loginID, client.AccInfo.UserID, (int)_accType);
                    if (errJgs.Err != ERR.SUCCESS)
                    {
                        MessageBox.Show(errJgs.ErrMsg, errJgs.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Warning);
                        return;
                    }
                }
                MessageBox.Show(tip, "提示信息", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }