Exemplo n.º 1
0
        public async Task <CustomerViewModel> Lock(int id)
        {
            var x = await _context.Customer.FindAsync(id);

            if (x == null)
            {
                return(null);
            }

            x.Status = CustomerStatus.Locked;

            await _context.SaveChangesAsync();

            return(new CustomerViewModel
            {
                CustomerID = x.CustomerID,
                CustomerName = x.CustomerName,
                TFN = x.TFN,
                Address = x.Address,
                City = x.City,
                State = x.State,
                PostCode = x.PostCode,
                Phone = x.Phone,
                Status = x.Status
            });
        }
Exemplo n.º 2
0
        public async Task <BillViewModel> Lock(int id)
        {
            var x = await _context.BillPay.FindAsync(id);

            if (x == null)
            {
                return(null);
            }

            x.Status = BillPayStatus.Blocked;

            await _context.SaveChangesAsync();

            return(new BillViewModel
            {
                BillPayID = x.BillPayID,
                AccountNumber = x.AccountNumber,
                PayeeID = x.PayeeID,
                Amount = x.Amount,
                ScheduleDate = x.ScheduleDate,
                Period = x.Period,
                ModifyDate = x.ModifyDate,
                Status = x.Status
            });
        }