Пример #1
0
        public async Task <ActionResult <ItemResponse <int> > > Insert(UserAddRequest model)
        {
            string token       = "";
            int    tokenTypeId = 1;

            try
            {
                ItemResponse <int> response = new ItemResponse <int>();
                response.Item = _userService.Insert(model);
                if (response.Item > 0)
                {
                    // Other co-workers' content
                    token = _tokenService.CreateToken(response.Item, tokenTypeId);
                    await _emailService.ProcessRequest(model.Email, token);

                    return(Created201(response));
                }
                else
                {
                    return(StatusCode(400, new ErrorResponse("Register Fails")));
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.ToString());
                return(StatusCode(500, new ErrorResponse(ex.Message)));
            }
        }
Пример #2
0
 public ActionResult <ItemResponse <int> > Add(UserAddRequest model)
 {
     try
     {
         int id = _userService.Add(model);
         if (id > 0)
         {
             _userService.AddUserRoleId(id, model.UserTypeId);
             var token = Guid.NewGuid();
             TokensAddRequest tokenModel = new TokensAddRequest();
             int tokenId = _tokensService.Insert(tokenModel, 1, token, id);
             _emailService.RegisterEmail(model.Email, token);
             ItemResponse <int> resp = new ItemResponse <int>();
             resp.Item = id;
             return(Created201(resp));
         }
         else
         {
             return(Ok200(new SuccessResponse()));
         }
     }
     catch (System.Exception ex)
     {
         Logger.LogError(ex.ToString());
         return(StatusCode(500, new ErrorResponse(ex.Message)));
     }
 }
Пример #3
0
        public async Task <IActionResult> Add(
            [FromBody] UserAddRequest userDto,
            CancellationToken cancellationToken = default)
        {
            var user = userDto.ToDal();

            try
            {
                await _dbContext
                .AddAsync(user, cancellationToken);

                var state = await _dbContext.SaveChangesAsync();

                return(Ok(user.Id));
            }
            catch (DbUpdateException ex)
                when(ex.IsPgSqlKeyViolationException())
                {
                    return(Conflict(ex.InnerException.Message));
                }
            catch (Exception ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Пример #4
0
        public async Task <HttpResponseMessage> Add(UserAddRequest request, string role = null)
        {
            int userId = 0;

            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            ;

            //fix create below

            try
            {
                userId = _userService.Create(request, role);
            }
            catch (Exception)
            {
                ErrorResponse error = new ErrorResponse("There was an error creating your account.");
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, error));
            }



            int  TokenTypeId = 2;
            Guid getToken    = _tokenService.GenerateToken(userId, TokenTypeId);
            bool result      = await _emailService.ConfirmationSend(request, getToken);

            ItemResponse <int> resp = new ItemResponse <int>();

            resp.Item = userId;

            return(Request.CreateResponse(HttpStatusCode.OK, resp));
        }
Пример #5
0
        public async Task <bool> ConfirmationSend(UserAddRequest request, Guid guidToken)
        {
            //return bool based on response code 202 or 200
            Response response = null;
            bool     result   = false;

            try
            {
                SendGridClient  client = new SendGridClient(_siteConfigService.SendGridApiKey);
                SendGridMessage msg    = new SendGridMessage();
                msg.AddTo(new EmailAddress(request.Email));
                msg.From        = new EmailAddress(_siteConfigService.SiteAdminEmailAddress);
                msg.Subject     = "Confirm Registration to GSwap";
                msg.HtmlContent = ConfirmationBody(request, guidToken);


                response = await client.SendEmailAsync(msg);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            //throw exception based on respoinse message if false
            if (response.StatusCode == System.Net.HttpStatusCode.Accepted)
            {
                result = true;
            }
            else
            {
                throw new Exception(response.Body.ToString());
            }

            return(result);
        }
        public async Task <IHttpActionResult> Create(UserAddRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var user = new AppUser {
                UserName = request.Username, Email = request.Email, JoinDate = DateTime.Now.Date
            };

            IdentityResult createUserResult = await AppUserManager.CreateAsync(user, request.Password);

            if (!createUserResult.Succeeded)
            {
                return(GetErrorResult(createUserResult));
            }

            IdentityResult addUserToRoleResult = await AppUserManager.AddToRoleAsync(user.Id, "user");

            if (!addUserToRoleResult.Succeeded)
            {
                return(GetErrorResult(addUserToRoleResult));
            }

            string code = await this.AppUserManager.GenerateEmailConfirmationTokenAsync(user.Id);

            var callbackUrl = new Uri(Url.Link("ConfirmEmailRoute", new { userId = user.Id, code }));

            await this.AppUserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

            return(Created(new Uri(Url.Link("GetUserById", new { id = user.Id })), TheModelFactory.Create(user)));
        }
        public int Create(UserAddRequest model)
        {
            //make sure the password column can hold long enough string. put it to 100 to be safe
            int userId = 0;

            string salt           = BCrypt.BCryptHelper.GenerateSalt();
            string hashedPassword = BCrypt.BCryptHelper.HashPassword(model.Password, salt);

            //DB provider call to create user and get us a user id
            _dataProvider.ExecuteNonQuery("dbo.Users_Insert", inputParamMapper : delegate(SqlParameterCollection parms)
            {
                SqlParameter parm  = new SqlParameter();
                parm.ParameterName = "@Id";
                parm.SqlDbType     = SqlDbType.Int;
                parm.Direction     = ParameterDirection.Output;
                parms.Add(parm);
                parms.AddWithValue("@Email", model.Email);
                parms.AddWithValue("@Password", hashedPassword);
                parms.AddWithValue("@RoleId", model.RoleId);
            }, returnParameters : delegate(SqlParameterCollection parms)
            {
                Int32.TryParse(parms["@Id"].Value.ToString(), out userId);
            });


            return(userId);
            //be sure to store both salt and passwordHash
            //DO NOT STORE the original password value that the user passed us
        }
Пример #8
0
        public async Task <HttpResponseMessage> Register(UserAddRequest model)
        {
            MethodBase methodName = new StackTrace().GetFrame(0).GetMethod();

            try
            {
                if (!ModelState.IsValid)
                {
                    logger.InfoFormat(@"Executing " + methodName + ". Invalid data sent to server" + ModelState);
                    return(CreateErrorResponse());
                }

                ItemResponse <int> responseBody = new ItemResponse <int>();
                responseBody.Item = await _service.Create(model);

                if (responseBody.Item == 0)
                {
                    logger.InfoFormat(@"Executing " + methodName + ". Registration failed. Email: " + model.EmailAddress);
                    return(CreateErrorResponse());
                }

                return(Request.CreateResponse(HttpStatusCode.Created, responseBody));
            }
            catch (Exception e)
            {
                logger.Error("An error occured when executing " + methodName, e);
                return(CreateErrorResponse());
            }
        }
Пример #9
0
        public void Usuario_SaveTemplate()
        {
            if (rep.iDClassSession == null)
            {
                Assert.Inconclusive("iDClass não conectado");
            }

            //UserUpdateRequest uur = new UserUpdateRequest();
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = 444;
            uur.Usuario[0].Nome = "Fabio 2";
            // Digital TXAI indicador direito
            //uur.Usuario[0].Templates = new string[] { "SUNSUzIxAAAMbAMBAAAAAMUAxQDwAJABAAAAhBIfXwAUAHwPrAA1AJcPSAA2AG4PfQA/ABQPogBeAJkPxgBjACUPhgBoAB0PewB2AIQPbgB9ABYPyACRACoPrgChAKkPDQCxAFUPowCyAKYPVwDbAPsP4wDmAKcPFgD2ANYPiQD/AKoPtwAUAaUPQQAVAdwPfAAZAYsOogAaAaIPygAlAZYPlQArAY8POQA3AVAOyAA9AY0PtgBCAYcPSQBTAfUP3QBbAYQPqwBeAXkPKwBvAe0PVAB3AXIPXhIvaRfnNgNjhBd17vYbXi9TpvtnfIt8WnzudbIH4o2b/AuRwZlWhMYIaXDZaefsVZRO+Fd/woAXBLuFMQXCgKuHZ4NDXxtDsf2/fYcno1PXI/cnOwcrE3cDx/1ng5/fKSP6CQ8cUQb5EkYa7o0/CatTyeMS/PrqORXV/oL5LQqJ8kYRze2OBAoKXlz6dX9naQm5+h4J8f1KENLxNqTChu4KpvmX/HsN2vTm7wf1dvqef1+fxn6Wh78n5dwnOSA8AQKUJNEMAIIBDDg4aP8JAJoBEP//wDbABwCvARP/OP8NAHIFCUA+wUP+EwAtEPRG+8HAQf/AwFhGBgBbEYOJwQcAYxQJS00HAFsXesB3wgcARDV0g2gRAEw2+i/+//5AwGJHCABHOm1pag4AgkATMFTBwf///8AXAAVK3P/+MEb9wf5E/sDAVP8SAAFa3P84/v7AL/5ASg8An1qacJeDwcB7BADKZCJUDgCCZpORxML/wsDCwGQNAIpnF/44/1XCgQYAxWcpe/8GAIhsHP///sEOAHZxjMSSfnBuDwB3d4DClsHBwcHB/cJsDwB/eRz/S//BUHfBBgBzfhMz/xwAAo/TNcAw//4oQT7+wv9fPA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JcEEKxe/T4LEKVidET/wcFqERDtZ4PCUm3+wcDB/sJKDBDocoB7ZFv/BhDqfn3AcwMQ34p9wQBEQgEBAAAAFgAAAAACBQAAAAAAAEVC" };
            // Digital Fabio indicaro direito


            string template_iDX     = "SUNSUzIxAAAJwgMBAAAAAMUAxQDvADoBAAAAg0gUtgAWAJQPrwAhAJEPlABSAIwP0wBWABwPlQBcABcP4QB0AJ0PggCUAHsP5ACWABkOtgClACkPkgDDAJMPggDMAGcOQgDrAGAPqgD6AKYPeAD+AO0OogAIAZ8PbAAQAfcOmgATAYgPnwAfAYUMNAAnAekPugAoAYwORAdDCx97yP9HBht3MHfL/vtzloDjB+uTJI+7n2f/koAihUN3O+kTVkcWJn3f8B//v5hPEOeyWS3TbKMZBdVjfdvuP2ovdmt7MQgyICYi7fqqZp5TPRi5+CkeYQ6PcJd1KAfR6NLkrP/B6gn7i/dji4P/gQuOBpru19wMIDgBAk8eKgMAswYXwQYAbw2DwVwDAIgVDP4DAM4iGsAJAB4i8P/+U/3/CQCMIA9YQ8EFALMkEDgFACIq+l0NAFwgAC9LVmwTABo78MA+Nv1KRlQSAA9N6cD9wTVBRP9UDACQTYzAkHfAgwwAkFOJwMGQfowJAJhTEEDAWQ0AkFuMwcLAlMLAwnEIAJhbEP7AN8EUAA1c4jU4/sD+N/9EZAkAl2AXVFX/DAB+kYanwcB7wP4MAIaWFjFTwmsNAH6XgMPEwH7AwEMHALinKcDAaxgAB6nQwCrB/cL+/f///v3AwP//wMDAwP8IAI/AnMTGxcFcGQADwtBF/UD/wfz///3+wP/+wf/B/sL/CwB+yHfGwsD//1P+GQAJys9GQP/AKv7+///+W8DARwUAhs0W/UIGAH7Pa8TBOwQAhtYaKxoAB9facP7/Pv7+/v/9/v//wMD+wf/BRAsAftdiw/////3D/08IAH/fWk9TGQAS4NxzwP87/v78/v/+/sBYfv8IAIriJHHAXQkAguNT///+/8A9BACI4zTEwRsABevWwMDAwEY1/S79wP7+wGt0BQA97WDASwUAQ+9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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
            string template_iDClass = RepCid.TemplateToiDClass(Convert.FromBase64String(template_iDX));

            uur.Usuario[0].Templates = new string[] { template_iDClass };

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Пример #10
0
        public int Insert(UserAddRequest model)
        {
            int    id             = 0;
            string hashedPassword = HashPassword(model.Password);

            _dataProvider.ExecuteNonQuery(
                "dbo.Users_Insert",
                inputParamMapper : delegate(SqlParameterCollection paramCol)
            {
                paramCol.AddWithValue("@Email", model.Email);
                paramCol.AddWithValue("@PasswordHash", hashedPassword);
                paramCol.AddWithValue("@IsConfirmed", model.IsConfirmed);
                paramCol.AddWithValue("@Status", model.Status);
                paramCol.AddWithValue("@RoleName", model.Role);

                SqlParameter paramId = new SqlParameter("@Id", System.Data.SqlDbType.Int);
                paramId.Direction    = System.Data.ParameterDirection.Output;
                paramCol.Add(paramId);
            },
                returnParameters : delegate(SqlParameterCollection param)
            {
                Int32.TryParse(param["@Id"].Value.ToString(), out id);
            }
                );

            return(id);
        }
Пример #11
0
        public int Registration(UserAddRequest model)
        {
            //password encryption should be added.
            int result = 0;

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                string cmdText = "Accounts_Insert";
                using (SqlCommand cmd = new SqlCommand(cmdText, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlParameter parm = new SqlParameter();
                    parm.ParameterName = "@Id";
                    parm.SqlDbType     = System.Data.SqlDbType.Int;
                    parm.Direction     = System.Data.ParameterDirection.Output;

                    cmd.Parameters.Add(parm);
                    cmd.Parameters.AddWithValue("@FirstName", model.FirstName);
                    cmd.Parameters.AddWithValue("@LastName", model.LastName);
                    cmd.Parameters.AddWithValue("@Age", model.Age);
                    cmd.Parameters.AddWithValue("@Email", model.Email);
                    cmd.Parameters.AddWithValue("@Password", model.Password);

                    conn.Open();
                    cmd.ExecuteNonQuery();
                    result = (int)cmd.Parameters["@Id"].Value;
                    conn.Close();
                }
            }
            return(result);
        }
Пример #12
0
        private int Add(UserAddRequest request, string salt, string passwordHash, string role)
        {
            int userId = 0;

            _dataProvider.ExecuteNonQuery("dbo.Users_Insert"
                                          , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@FirstName", request.FirstName);
                paramCollection.AddWithValue("@LastName", request.LastName);
                paramCollection.AddWithValue("@Email", request.Email);
                paramCollection.AddWithValue("@Number", request.Number);
                paramCollection.AddWithValue("@ZipCode", request.ZipCode);
                paramCollection.AddWithValue("@Salt", salt);
                paramCollection.AddWithValue("@PasswordHash", passwordHash);
                paramCollection.AddWithValue("@Role", role);

                SqlParameter idParameter = new SqlParameter("@Id", SqlDbType.Int);
                idParameter.Direction    = System.Data.ParameterDirection.Output;

                paramCollection.Add(idParameter);
            }, returnParameters : delegate(SqlParameterCollection param)
            {
                Int32.TryParse(param["@Id"].Value.ToString(), out userId);
            }
                                          );

            return(userId);
        }
Пример #13
0
        public async Task <HttpResponseMessage> Add(UserAddRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
            }
            try
            {
                IdentityUser entityUser = UserService.CreateUser(model.Email, model.Password);
                //Adds Newly created User to AspNetUserRoles table with the default role of 'user'
                AspNetUserRoleAddRequest role = new AspNetUserRoleAddRequest();
                role.UserId = entityUser.Id;
                role.RoleId = 2;
                AspNetUserRoleService.Post(role);

                SuccessResponse response = await SendNewConfirmationEmail(model.Email, entityUser.Id);

                //PersonAddRequest person = new PersonAddRequest();
                //ItemResponse<int> response = new ItemResponse<int>();
                //person.Email = model.Email;
                //person.AspNetUserId = entityUser.Id;
                //response.Item = PersonService.Insert(person);
                //UserService service = new UserService();
                //LoginResponse lR = service.Signin(model.Email, model.Password);
                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            catch
            {
                ErrorResponse response = new ErrorResponse("User already exists");
                return(Request.CreateResponse(HttpStatusCode.Conflict, response));
            }
        }
Пример #14
0
        ////////////////////////////

        public static int AddUser(UserAddRequest model, string UserId)
        {
            int id = 0;

            DataProvider.ExecuteNonQuery(GetConnection, "dbo.AddUser"
                                         , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                if (model != null)
                {
                    paramCollection.AddWithValue("@FirstName", model.FirstName);
                    paramCollection.AddWithValue("@LastName", model.LastName);
                    paramCollection.AddWithValue("@Email", model.Email);
                    paramCollection.AddWithValue("@UserType", model.UserType);
                    paramCollection.AddWithValue("@Period", model.Period);
                    paramCollection.AddWithValue("@UserId", UserId);
                }

                SqlParameter p = new SqlParameter("@Id", SqlDbType.Int);
                p.Direction    = ParameterDirection.Output;

                paramCollection.Add(p);
            }, returnParameters : delegate(SqlParameterCollection param)
            {
                int.TryParse(param["@Id"].Value.ToString(), out id);
            }
                                         );

            return(id);
        }
Пример #15
0
 private static void AddParameters(UserAddRequest model, SqlParameterCollection col)
 {
     col.AddWithValue("@FirstName", model.FirstName);
     col.AddWithValue("@LastName", model.LastName);
     col.AddWithValue("@Password", model.Password);
     col.AddWithValue("@Email", model.Email);
     col.AddWithValue("@Admin", model.Admin);
 }
Пример #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <ServiceResponse> Add(UserAddRequest request)
        {
            ServiceResponse response = new ServiceResponse();

            try
            {
                var user = new User
                {
                    Email    = request.Email,
                    Name     = request.Name,
                    Password = request.Password,
                    Phone    = request.Phone,
                    Surname  = request.Surname
                };

                var hasUser = await UserRepository.HasUser(what => what.Name == request.Name || what.Surname == request.Surname || what.Phone == request.Phone || what.Email == request.Email);

                if (hasUser)
                {
                    response.Status  = false;
                    response.Data    = request;
                    response.Message = $"{request.Name} {request.Surname} kullanıcısı kayıtlı";

                    return(await Task.FromResult(response));
                }

                UserRepository.Add(user);

                if (await UserRepository.Save() != -1)
                {
                    Logger.LogInformation("@user Kayıt işlemi Yapıldı", user);

                    response.Status = true;

                    response.Data = user;

                    response.Message = "Kayıt işlemi Yapıldı";
                }
                else
                {
                    Logger.LogError("Kayıt işlemi Yapılamadı", user);

                    response.Status = false;

                    response.Message = "işlem sırasında bir hata alındı.";
                }
            }
            catch (Exception ex)
            {
                response.Status  = false;
                response.Message = "işlem sırasında bir hata alındı.";

                Logger.LogError(ex.Message, ex);
            }

            return(await Task.FromResult(response));
        }
Пример #17
0
        public async Task <IResponseEntity> CreateAsync(UserAddRequest req)
        {
            var item = _mapper.Map <SysUserEntity>(req);

            item.Password = MD5Encrypt.Encrypt32(item.Password);
            var result = await _sysUserRepository.InsertAsync(item);

            return(ResponseEntity.Result(result != null && result?.Id != ""));
        }
Пример #18
0
        /// <summary>
        /// 注册功能
        /// </summary>
        public JsonResult UserRegist(UserAddRequest userAddRequest)
        {
            var res = bll.AddUser(userAddRequest);

            //GET请求返回
            //return Json(res,JsonRequestBehavior.AllowGet);

            //POST请求返回
            return(Json(res));
        }
Пример #19
0
        /// <summary>
        /// 用户注册方法
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public UserAddResponse UserRegist(UserAddRequest request)
        {
            UserAddResponse response = new UserAddResponse();

            if (string.IsNullOrEmpty(request.UserName))
            {
                response.Status  = false;
                response.Message = "手机号不能为空";
                return(response);
            }
            if (string.IsNullOrEmpty(request.Pwd))
            {
                response.Status  = false;
                response.Message = "密码不能为空";
                return(response);
            }

            //判断手机号是否已注册
            var isExist = userDal.IsExistPhone(request.UserName);

            if (isExist)
            {
                response.Status  = false;
                response.Message = "手机号已存在";
                return(response);
            }

            //对密码进行加密
            //1 生成一个盐  为什么要生成一个盐?
            var salt = Generate.GenerateSalt();
            //2 加密
            var password = MD5Encrypt.MD5Encrypt32(request.Pwd + salt);

            UserInfo user = new UserInfo()
            {
                UserName    = request.UserName,
                PhoneNumder = request.UserName,//13621807335
                NickName    = request.UserName.ToNickName(),
                UserPass    = password,
                Salt        = salt
            };

            var res = userDal.UserRegist(user);

            if (res > 0)
            {
                response.IsRegistSuccess = true;
            }
            else
            {
                response.Status  = false;
                response.Message = "注册失败";
            }
            return(response);
        }
Пример #20
0
        public IActionResult AddNewUser([FromBody] UserAddRequest addRequest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            UserAddResponse response = _usersControllerUtilities.AddNewUser(addRequest);

            return(Ok(response));
        }
Пример #21
0
        public async Task <(bool result, string message)> AddUsersAsync(UserAddRequest addRequest)
        {
            var usersModel = new User()
            {
                Name = addRequest.Name
            };

            var result = await baseDal.AddAsync(usersModel, SqlSugarEnums.SqlSugarAddReturnAction.IdentityIntoEntity);

            return(result ? (true, "新增成功!") : (false, "新增失败!"));
        }
Пример #22
0
        public BasicResponse <UserInfo> AddUser(UserAddRequest userrequest)
        {
            UserInfo userDTO = userrequest.UserInfo;

            if (userDTO.CreateTime == new DateTime(1, 1, 1, 0, 0, 0))
            {
                userDTO.CreateTime = DateTime.Now;
            }
            if (userDTO.LastLoginTime == new DateTime(1, 1, 1, 0, 0, 0))
            {
                userDTO.LastLoginTime = DateTime.Now;
            }
            if (userDTO.LoginTime == new DateTime(1, 1, 1, 0, 0, 0))
            {
                userDTO.LoginTime = DateTime.Now;
            }
            if (userDTO.CreateTime != null)
            {
                userDTO.CreateTime = Convert.ToDateTime(userDTO.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            if (userDTO.LastLoginTime != null)
            {
                userDTO.LastLoginTime = Convert.ToDateTime(userDTO.LastLoginTime.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            if (userDTO.LoginTime != null)
            {
                userDTO.LoginTime = Convert.ToDateTime(userDTO.LoginTime.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            if (userDTO == null)
            {
                //throw new BusinessException("用户DTO对象不能为空!");
                ThrowException("AddUser", new Exception("用户DTO对象不能为空!"));
            }
            if (string.IsNullOrEmpty(userDTO.UserCode))
            {
                //throw new BusinessException("用户名不能为空,请重新输入!");
                ThrowException("AddUser", new Exception("用户名不能为空,请重新输入!"));
            }
            if (CheckUserNameExist(userDTO.UserCode))
            {
                //校验用户名是否重复
                ThrowException("AddUser", new Exception(String.Format("用户名:{0} 已经重复,请重新输入!", userDTO.UserCode)));
            }

            var _user        = ObjectConverter.Copy <UserInfo, UserModel>(userDTO);
            var resultuser   = _Repository.AddUser(_user);
            var userresponse = new BasicResponse <UserInfo>();

            userresponse.Data = ObjectConverter.Copy <UserModel, UserInfo>(resultuser);
            return(userresponse);
        }
Пример #23
0
        public UserAddResponse UserRegist(UserAddRequest request)
        {
            UserAddResponse response = new UserAddResponse();

            if (string.IsNullOrEmpty(request.UserName))
            {
                response.Status  = false;
                response.Message = "用户名不能为空";
                return(response);
            }
            if (string.IsNullOrEmpty(request.Pwd))
            {
                response.Status  = false;
                response.Message = "密码不能为空";
                return(response);
            }
            //是否已经注册
            var isExist = dal.IsExistPhone(request.UserName);

            if (isExist)
            {
                response.Status  = false;
                response.Message = "用户名已经存在";
                return(response);
            }
            //对密码进行加密
            //1.先生成一个盐
            var salt = Generate.GenerateSalt();
            //2.加密
            var      password = MD5Encrypt.MD5Encrypt32(request.Pwd);
            UserInfo userInfo = new UserInfo()
            {
                UserName = request.UserName,
                Phone    = request.Phone,
                PassWord = password,
                Salt     = salt
            };
            var res = dal.UserRegist(userInfo);

            if (res > 0)
            {
                response.RegistSuccess = true;
                response.Message       = "注册成功";
            }
            else
            {
                response.RegistSuccess = false;
                response.Message       = "注册失败";
            }
            return(response);
        }
Пример #24
0
        private string ConfirmationBody(UserAddRequest request, Guid guidToken)
        {
            string body;

            using (StreamReader reader = new StreamReader(HttpContext.Current.Server.MapPath(@"~\Content\confirmationEmail_sendgrid.html")))
            {
                body = reader.ReadToEnd();
            }
            body = body.Replace("{title}", "Account Confirmation");
            body = body.Replace("{token}", guidToken.ToString());
            body = body.Replace("{body}", "Please click the link below or copy and paste into your browser");
            body = body.Replace("{domain}", _siteConfigService.SiteDomain);
            return(body);
        }
Пример #25
0
        public HttpResponseMessage AddUser(UserAddRequest model)
        {
            string userId = Guid.NewGuid().ToString();

            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            ItemResponse <int> response = new ItemResponse <int>();

            response.Item = UserService.AddUser(model, userId);

            return(Request.CreateResponse(response));
        }
Пример #26
0
        public ActionResult Add(UserAddRequest model)
        {
            ActionResult result = null;

            try
            {
                int id = _service.Add(model);
                result = Created201(id);
            }
            catch (Exception ex)
            {
                result = StatusCode(500, ex.ToString());
            }

            return(result);
        }
Пример #27
0
 public HttpResponseMessage Insert(UserAddRequest model)
 {
     if (!ModelState.IsValid)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadGateway, ModelState));
     }
     try
     {
         _userService.Insert(model);
         return(Request.CreateResponse(HttpStatusCode.OK, model));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Пример #28
0
        public void Usuario_SaveTemplate()
        {
            //UserUpdateRequest uur = new UserUpdateRequest();
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = 108;
            uur.Usuario[0].Nome = "Teste Add Modify Template";
            // Digital TXAI indicador direito
            uur.Usuario[0].Templates = new string[] { "SUNSUzIxAAAMbAMBAAAAAMUAxQDwAJABAAAAhBIfXwAUAHwPrAA1AJcPSAA2AG4PfQA/ABQPogBeAJkPxgBjACUPhgBoAB0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ewna9OfwB/l++2cLXxfl2ENkIDgBAookQgcAsQAaV0wLAIABDP9GQ00IAKEEE/89YA0AZQUAMT3AwP9TDgBlCg/BQUTAWP8EAFoRgIMHAGIUCUvA/gYAWhd6wl8HAEM1ccHBfhEASzb6/zL+NURz/wcARTtteGoWABE850H/QUFgQ0v+DgCBQBPA/UzA/207EgAFVt7A/v48PUD+/08PAKFcmnTCl3xcBADKZCJUDgCCZpORxML/wsDCwHMNAIpnF/7/PlF1BgDFZyl7wAYAiGwc/zgOAHZxicPDwYlw/3sPAHZ3gMLCicFwUsAPAH55GjvC/Vh3eAYAcX4Q/v5CGwABkdP+wD7+wP79/v///sA7wP9ghAcAypMpVcH/GwACo9BARv/9wPz+/8D//v/+wMD+wf/BeBoAEK3WVDj+/P79/sD+/8DB/cDAwcDCcxQAnq+nwcHCwcTExMH/w2TAwMFsCgCltS1S/4nABgBb2O35+UEEAGTyWlUaABXz0EzB/kb9+/z//jtccYQZABr218DAU//+JjP+wFl4kAMAE/tWwAoAZ/5W/VlHwQkAbf4nwsDC/8NZDgCG/6T/wcjGxMDCPlsYELcQpP83wMDDmsPCwcB7Ul8WELQWnjVOwcTGxcLBwcDAwf7BVAUQbhd9xmwYEMcokP/+/U+AxsjCwsDAwf//wf/AxAwQkSqQm8Q3wlkDEMs/DP8XEOk/k21HNv/AysjAwcH9wMP8wBAQw0CJ/2rAxIRifA8QskKJaXXCWMLCwQ0QUFH3V//A/sP+/1UOENhYicL+fsL+c5QNEKRbfWhpcJcEEKxe/T4LEKVidET/wcFqERDtZ4PCUm3+wcDB/sJKDBDocoB7ZFv/BhDqfn3AcwMQ34p9wQBEQgEBAAAAFgAAAAACBQAAAAAAAEVC" };

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Пример #29
0
        public int Insert(UserAddRequest model)
        {
            SqlParameter id = SqlDbParameter.Instance.BuildParam("@Id", 0, System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Output);

            _baseService.SqlAdapter.ExecuteQuery(new DbCommandDef
            {
                DbCommandText = "dbo.TheStatus_Insert",
                DbCommandType = System.Data.CommandType.StoredProcedure,
                DbParameters  = new SqlParameter[]
                {
                    new SqlParameter("@Username", model.UserName),
                    new SqlParameter("@UserStatus", model.Status),
                    id
                }
            });
            return(id.Value.ToInt32());
        }
Пример #30
0
        public void Usuario_SaveTemplate()
        {
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS  = (ulong)Config.pisTEST;
            uur.Usuario[0].Nome = "Fabio Teste";
            string template_iDX     = "SUNSUzIxAAAJwgMBAAAAAMUAxQDvADoBAAAAg0gUtgAWAJQPrwAhAJEPlABSAIwP0wBWABwPlQBcABcP4QB0AJ0PggCUAHsP5ACWABkOtgClACkPkgDDAJMPggDMAGcOQgDrAGAPqgD6AKYPeAD+AO0OogAIAZ8PbAAQAfcOmgATAYgPnwAfAYUMNAAnAekPugAoAYwORAdDCx97yP9HBht3MHfL/vtzloDjB+uTJI+7n2f/koAihUN3O+kTVkcWJn3f8B//v5hPEOeyWS3TbKMZBdVjfdvuP2ovdmt7MQgyICYi7fqqZp5TPRi5+CkeYQ6PcJd1KAfR6NLkrP/B6gn7i/dji4P/gQuOBpru19wMIDgBAk8eKgMAswYXwQYAbw2DwVwDAIgVDP4DAM4iGsAJAB4i8P/+U/3/CQCMIA9YQ8EFALMkEDgFACIq+l0NAFwgAC9LVmwTABo78MA+Nv1KRlQSAA9N6cD9wTVBRP9UDACQTYzAkHfAgwwAkFOJwMGQfowJAJhTEEDAWQ0AkFuMwcLAlMLAwnEIAJhbEP7AN8EUAA1c4jU4/sD+N/9EZAkAl2AXVFX/DAB+kYanwcB7wP4MAIaWFjFTwmsNAH6XgMPEwH7AwEMHALinKcDAaxgAB6nQwCrB/cL+/f///v3AwP//wMDAwP8IAI/AnMTGxcFcGQADwtBF/UD/wfz///3+wP/+wf/B/sL/CwB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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
            string template_iDClass = RepCid.TemplateToiDClass(Convert.FromBase64String(template_iDX));

            uur.Usuario[0].Templates = new string[] { template_iDClass };

            StatusResult st = RestJSON.SendJson <StatusResult>(Config.repIP, uur, session);

            if (!st.isOK)
            {
                Assert.Inconclusive(st.Status);
            }
        }
Пример #31
0
        public void Usuario_SaveTemplate()
        {
            if (rep.iDClassSession == null)
                Assert.Inconclusive("iDClass não conectado");

            //UserUpdateRequest uur = new UserUpdateRequest();
            UserAddRequest uur = new UserAddRequest();

            uur.Usuario[0].PIS = 444;
            uur.Usuario[0].Nome = "Fabio 2";
            // Digital TXAI indicador direito
            //uur.Usuario[0].Templates = new string[] { "SUNSUzIxAAAMbAMBAAAAAMUAxQDwAJABAAAAhBIfXwAUAHwPrAA1AJcPSAA2AG4PfQA/ABQPogBeAJkPxgBjACUPhgBoAB0PewB2AIQPbgB9ABYPyACRACoPrgChAKkPDQCxAFUPowCyAKYPVwDbAPsP4wDmAKcPFgD2ANYPiQD/AKoP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lCg/BQUTAWP8EAFoRgIMHAGIUCUvA/gYAWhd6wl8HAEM1ccHBfhEASzb6/zL+NURz/wcARTtteGoWABE850H/QUFgQ0v+DgCBQBPA/UzA/207EgAFVt7A/v48PUD+/08PAKFcmnTCl3xcBADKZCJUDgCCZpORxML/wsDCwHMNAIpnF/7/PlF1BgDFZyl7wAYAiGwc/zgOAHZxicPDwYlw/3sPAHZ3gMLCicFwUsAPAH55GjvC/Vh3eAYAcX4Q/v5CGwABkdP+wD7+wP79/v///sA7wP9ghAcAypMpVcH/GwACo9BARv/9wPz+/8D//v/+wMD+wf/BeBoAEK3WVDj+/P79/sD+/8DB/cDAwcDCcxQAnq+nwcHCwcTExMH/w2TAwMFsCgCltS1S/4nABgBb2O35+UEEAGTyWlUaABXz0EzB/kb9+/z//jtccYQZABr218DAU//+JjP+wFl4kAMAE/tWwAoAZ/5W/VlHwQkAbf4nwsDC/8NZDgCG/6T/wcjGxMDCPlsYELcQpP83wMDDmsPCwcB7Ul8WELQWnjVOwcTGxcLBwcDAwf7BVAUQbhd9xmwYEMcokP/+/U+AxsjCwsDAwf//wf/AxAwQkSqQm8Q3wlkDEMs/DP8XEOk/k21HNv/AysjAwcH9wMP8wBAQw0CJ/2rAxIRifA8QskKJaXXCWMLCwQ0QUFH3V//A/sP+/1UOENhYicL+fsL+c5QNEKRbfWhpcJcEEKxe/T4LEKVidET/wcFqERDtZ4PCUm3+wcDB/sJKDBDocoB7ZFv/BhDqfn3AcwMQ34p9wQBEQgEBAAAAFgAAAAACBQAAAAAAAEVC" };
            // Digital Fabio indicaro direito
            
            
            string template_iDX= "SUNSUzIxAAAJwgMBAAAAAMUAxQDvADoBAAAAg0gUtgAWAJQPrwAhAJEPlABSAIwP0wBWABwPlQBcABcP4QB0AJ0PggCUAHsP5ACWABkOtgClACkPkgDDAJMPggDMAGcOQgDrAGAPqgD6AKYPeAD+AO0OogAIAZ8PbAAQAfcOmgATAYgPnwAfAYUMNAAnAekPugAoAYwORAdDCx97yP9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ateToiDClass(Convert.FromBase64String(template_iDX));

            uur.Usuario[0].Templates = new string[] { template_iDClass };

            StatusResult st = (StatusResult)RestJSON.SendJson(rep.IP, uur, typeof(StatusResult), rep.iDClassSession);
            if (!st.isOK)
                Assert.Inconclusive(st.Status);

        }