コード例 #1
0
        public async Task <ActionResult <paymentDetails> > PostpaymentDetails(paymentDetails paymentDetails)
        {
            _context.paymentDetails.Add(paymentDetails);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetpaymentDetails", new { id = paymentDetails.Id }, paymentDetails));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }