Exemplo n.º 1
0
		public IHttpActionResult ExistData(UserExists dealerExists)
		{
			var exist = false;
			var message = string.Empty;

			var existUserName = _userService.ExistUserName(dealerExists.UserName);
			if (existUserName)
			{
				exist = true;
				message += "Login is exist.<br>";
			}

			var existEmail = _userService.ExistEmail(dealerExists.Email);
			if (existEmail)
			{
				exist = true;
				message += "Email is exist.<br>";
			}


			return Ok(new
			{
				data = new
				{
					exist,
					message
				}
			});
		}
 public async Task <bool> Handle(UserExists request, CancellationToken cancellationToken)
 {
     return(await _dbContext
            .Users
            .AsNoTracking()
            .AnyAsync(user => user.UserId == request.UserId));
 }
Exemplo n.º 3
0
 public async Task <ActionResult <bool> > GetUser(string id, string pw)
 {
     if (await UserExists.Run(id, pw, _context))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
 public async Task <ActionResult <List <Homework> > > PostHomework([Bind("id,pw")] auth user)
 {
     if (await UserExists.Run(user.id, user.pw, userDB))
     {
         GetHomeworks a = new GetHomeworks(_context, userDB, noteCatDB, userCatDB, noteClassDB, user.id);
         DelHomeworks();
         return(await a.Run());
     }
     return(null);
 }
        public IActionResult UserExists([FromQuery] UserExists model)
        {
            var result = _unitOfWork.UserExists(model);

            if (result)
            {
                return(Ok());
            }

            return(NotFound());
        }
        public async Task <ActionResult <List <SelectedCategory> > > PostCategory([Bind("id,pw")] auth user)
        {
            int no = await UserExists.RunNo(user.id, user.pw, userDB);

            if (no != 0)
            {
                var a = from b in await _context.SelectedCategories.ToListAsync()
                            where b.CatUName == no
                        select b;

                return(a.ToList());
            }
            return(null);
        }
 public bool UserExists(UserExists model)
 {
     return(UserRepository
            .Entities
            .Any(co => co.Email == model.Email || co.UserName == model.Email));
 }
Exemplo n.º 8
0
 public bool Handle(UserExists query) =>
 _archDbContext.Users.Any(x => x.Username == query.UserName);
Exemplo n.º 9
0
 public bool Handle(UserExists query) =>
 _authRepository.Any(_ => _.Username == query.UserName);