public async Task <ActionResult <paymentDetails> > PostpaymentDetails(paymentDetails paymentDetails) { _context.paymentDetails.Add(paymentDetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetpaymentDetails", new { id = paymentDetails.Id }, paymentDetails)); }
public async Task <IActionResult> PutpaymentDetails(int id, paymentDetails paymentDetails) { if (id != paymentDetails.Id) { return(BadRequest()); } _context.Entry(paymentDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!paymentDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public HttpResponseMessage makePayments(string studentID, double totalFineAmount, string reason, string TransactionID, string branchName, bool PaymentApproved) { ReturnData rd = new ReturnData(); paymentDetails c = new paymentDetails(); rd = c.makePayments(studentID, totalFineAmount, reason, TransactionID, branchName, PaymentApproved); string yourJson = JsonConvert.SerializeObject(rd);; var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }
public HttpResponseMessage RejectPayments(string paymentID) { ReturnData rd = new ReturnData(); paymentDetails c = new paymentDetails(); rd = c.RejectPayments(paymentID); string yourJson = JsonConvert.SerializeObject(rd);; var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }
public HttpResponseMessage loadFineSum() { string fineSum = ""; paymentDetails u = new paymentDetails(); fineSum = u.fineSum(); string yourJson = JsonConvert.SerializeObject(fineSum);; var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(yourJson, Encoding.UTF8, "application/json"); return(response); }