public async Task <IActionResult> Edit(long id, [Bind("Id,Amount,CustomersId,ContractDetailId,ContractId,ObjectsId,SupportTypeDefenition,Customer,PaymentDate,Reason,CreateDate,Pdid")] GetPaymentDuration getPaymentDuration) { if (id != getPaymentDuration.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(getPaymentDuration); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GetPaymentDurationExists(getPaymentDuration.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(getPaymentDuration)); }
public async Task <IActionResult> Create([Bind("Id,Amount,CustomersId,ContractDetailId,ContractId,ObjectsId,SupportTypeDefenition,Customer,PaymentDate,Reason,CreateDate,Pdid")] GetPaymentDuration getPaymentDuration) { if (ModelState.IsValid) { _context.Add(getPaymentDuration); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(getPaymentDuration)); }