public async Task <IActionResult> Edit(int id, [Bind("IddayDetails,Day,TimeFrom,TimeTo,Status,FkPeriod")] Daydetails daydetails) { if (id != daydetails.IddayDetails) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(daydetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DaydetailsExists(daydetails.IddayDetails)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(daydetails)); }
public async Task <IActionResult> Create([Bind("IddayDetails,Day,TimeFrom,TimeTo,Status,FkPeriod")] Daydetails daydetails) { if (ModelState.IsValid) { _context.Add(daydetails); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(daydetails)); }