Exemplo n.º 1
0
        public async Task <int> BillPay(int id, decimal amount, string schedule_date, int Period)
        {
            if (_context != null)
            {
                string   iDate = schedule_date;
                DateTime oDate = Convert.ToDateTime(iDate);

                var BillPay = new BillPay
                {
                    AccountNumber = id,
                    ModifyDate    = DateTime.UtcNow,
                    Amount        = amount,
                    ScheduleDate  = oDate,
                    PayeeID       = 1,
                    Period        = Period,
                };

                _context.Add(BillPay);
                _context.SaveChanges();
                //await _context.SaveChangesAsync();
                return(1);
            }

            return(0);
        }
Exemplo n.º 2
0
        public async Task <int> DeleteBillPay(int id)
        {
            if (_context != null)
            {
                var BillPay = new BillPay {
                    BillPayID = id
                };
                _context.Remove(BillPay);
                _context.SaveChanges();
                return(1);
            }

            return(0);
        }