Exemplo n.º 1
0
        public async Task <JobStage> Update(JobStage jobStage)
        {
            if (!await BelongsToUser(jobStage))
            {
                return(null);
            }
            _context.Entry(jobStage).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(jobStage);
        }
Exemplo n.º 2
0
        public async Task <bool> ChangePassword(User user, string password = null)
        {
            if (user.UserId != _userProvider.GetUserId())
            {
                return(false);
            }
            CreatePasswordHash(password, out byte[] passwordHash, out byte[] passwordSalt);
            user.PasswordHash          = Convert.ToBase64String(passwordHash);
            user.Salt                  = Convert.ToBase64String(passwordSalt);
            _context.Entry(user).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(true);
        }
Exemplo n.º 3
0
        public async Task <Stage> Update(Stage stage)
        {
            if (stage.UserId != userId)
            {
                return(null);
            }
            _context.Entry(stage).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(stage);
        }
        public async Task <Customer> Update(Customer customer)
        {
            if (customer.UserId != userId)
            {
                return(null);
            }
            _context.Entry(customer).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(customer);
        }
Exemplo n.º 5
0
        public async Task <Job> Update(Job job)
        {
            if (job.UserId != userId)
            {
                return(null);
            }
            _context.Entry(job).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(job);
        }
Exemplo n.º 6
0
        public async Task <Slot> Update(Slot slot)
        {
            if (slot.UserId != userId)
            {
                return(null);
            }
            _context.Entry(slot).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(slot);
        }
Exemplo n.º 7
0
        public async Task <ScheduleEntry> Update(ScheduleEntry scheduleEntry)
        {
            if (scheduleEntry.UserId != userId)
            {
                return(null);
            }
            _context.Entry(scheduleEntry).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            scheduleEntry = await GetById(scheduleEntry.ScheduleEntriesId);

            return(scheduleEntry);
        }