// To protect from overposting attacks, please 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(Werkbonpersoneel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WerkbonpersoneelExists(Werkbonpersoneel.PersoneelID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, please 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.Personeel.Add(Personeel); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, please 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.Werkbon.Add(Werkbon); await _context.SaveChangesAsync(); return(RedirectToPage("./Werknemer", new { id = Werkbon.WerkbonID })); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Werkbonpersoneel = await _context.Werkbonpersoneel.FindAsync(id); if (Werkbonpersoneel != null) { _context.Werkbonpersoneel.Remove(Werkbonpersoneel); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, please 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(Werkbon).State = EntityState.Modified; try { // Use function if werkbon.image exist if (!String.IsNullOrEmpty(Werkbon.Image)) { var base64Signature = Werkbon.Image.Split(",")[1]; var binarySignature = Convert.FromBase64String(base64Signature); System.IO.File.WriteAllBytes("wwwroot/images/" + Werkbon.Guid + ".png", binarySignature); } // Use function if werkbon.imageSecond exist if (!String.IsNullOrEmpty(Werkbon.ImageSecond)) { var base64SignatureSecond = Werkbon.ImageSecond.Split(",")[1]; var binarySignatureSecond = Convert.FromBase64String(base64SignatureSecond); System.IO.File.WriteAllBytes("wwwroot/images/" + Werkbon.GuidSecond + ".png", binarySignatureSecond); } await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WerkbonExists(Werkbon.WerkbonID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }