// GET: Purchases/Details/5
        public async Task <ActionResult <PurchaseDetailsDto> > Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var purchase = await _repository.GetPurchase(id.Value);

            if (purchase == null)
            {
                return(NotFound());
            }

            return(Ok(new PurchaseDetailsDto
            {
                Id = purchase.Id,
                AccountId = purchase.AccountId,
                AddressId = purchase.AddressId,
                OrderStatus = purchase.OrderStatus,
                ProductId = purchase.ProductId,
                Qty = purchase.Qty,
                TimeStamp = purchase.TimeStamp
            }));
        }
 public ActionResult AddOrEdit(int id = 0)
 {
     return(View(_purchaseRepo.GetPurchase(id)));
 }