Esempio n. 1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CompanyExists(Company.CompanyId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 2
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            return(RedirectToPage("./Index"));
        }
Esempio n. 3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            username = HttpContext.User.Identity.Name;
            Models.ApplicationUser selectedUser =
                _context.ApplicationUser.FirstOrDefault(c => c.Email == username);

            TemperatureMeasurement.ApplicationUserId = selectedUser.Id;
            _context.TemperatureMeasurement.Add(TemperatureMeasurement);
            await _context.SaveChangesAsync();

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

            Checklist = await _context.Checklist.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Esempio n. 5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ComplianceRecord = await _context.ComplianceRecord.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Esempio n. 6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            UserTask = await _context.UserTask.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
Esempio n. 7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TemperatureMeasurement = await _context.TemperatureMeasurement.FindAsync(id);

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

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