Beispiel #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(RoleWorker).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoleWorkerExists(RoleWorker.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.RoleWorker.Add(RoleWorker);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Technicians.Add(Tecnico);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Beispiel #4
0
        public async Task <IActionResult> OnPostAsync(int?IdRoleWorker)
        {
            if (IdRoleWorker == null)
            {
                return(NotFound());
            }

            RoleWorker = await _context.RoleWorker.FindAsync(IdRoleWorker);

            if (RoleWorker != null)
            {
                _context.RoleWorker.Remove(RoleWorker);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #5
0
        public async Task <IActionResult> OnPostAsync(string IdTechnician)
        {
            if (IdTechnician == null)
            {
                return(NotFound());
            }

            Tecnico = await _context.Technicians.FindAsync(IdTechnician);

            if (Tecnico != null)
            {
                _context.Technicians.Remove(Tecnico);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }