public async Task <ActionResult <EBillPayment> > PostEBillPayment(EBillPayment eBillPayment)
        {
            _context.BillPayments.Add(eBillPayment);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEBillPayment", new { id = eBillPayment.EBillPaymentId }, eBillPayment));
        }
        public async Task <IActionResult> PutEBillPayment(int id, EBillPayment eBillPayment)
        {
            if (id != eBillPayment.EBillPaymentId)
            {
                return(BadRequest());
            }

            _context.Entry(eBillPayment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EBillPaymentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("EBillPaymentId,EletricityBillId,PaymentDate,Amount,Mode,PaymentDetails,Remarks,IsPartialPayment,IsBillCleared,StoreId,UserId,EntryStatus,IsReadOnly")] EBillPayment eBillPayment)
        {
            if (id != eBillPayment.EBillPaymentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eBillPayment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EBillPaymentExists(eBillPayment.EBillPaymentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EletricityBillId"] = new SelectList(_context.EletricityBills, "EletricityBillId", "BillNumber", eBillPayment.EletricityBillId);
            ViewData["StoreId"]          = new SelectList(_context.Stores, "StoreId", "StoreName", eBillPayment.StoreId);
            return(View(eBillPayment));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("EBillPaymentId,EletricityBillId,PaymentDate,Amount,Mode,PaymentDetails,Remarks,IsPartialPayment,IsBillCleared,StoreId,UserId,EntryStatus,IsReadOnly")] EBillPayment eBillPayment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eBillPayment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EletricityBillId"] = new SelectList(_context.EletricityBills, "EletricityBillId", "BillNumber", eBillPayment.EletricityBillId);
            ViewData["StoreId"]          = new SelectList(_context.Stores, "StoreId", "StoreName", eBillPayment.StoreId);
            return(View(eBillPayment));
        }