Exemplo n.º 1
0
        public ActionResult <CustomerItem> Get(string id)
        {
            // Validation.
            if ((id == null) ||
                (id.Trim() == string.Empty))
            {
                return(BadRequest());
            }

            // Search Item.
            CustomerItem customerItem = _iCustomerServices.GetCustomer(id).Result;

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

            // Return.
            return(Ok(customerItem));
        }
Exemplo n.º 2
0
        public IActionResult Get(long Id)
        {
            _logger.LogError("Get method called");
            if (Id == 0)
            {
                return(BadRequest());
            }
            var customer = _customerServices.GetCustomer(Id);

            if (customer == null)
            {
                return(NotFound());
            }
            return(Ok(customer));
        }
Exemplo n.º 3
0
        public IActionResult Update(int id)
        {
            Customer            getCustomer         = ICustomerService.GetCustomer(id);
            CustomerUpdateModel customerUpdateModel = new CustomerUpdateModel
            {
                ID       = id,
                Name     = getCustomer.CustomerName,
                Lastname = getCustomer.CustomerLastname,
                City     = getCustomer.City,
                Country  = getCustomer.Country,
                Adress   = getCustomer.Adress,
                Phone    = getCustomer.Phone
            };

            return(View(customerUpdateModel));   //BU BİLGİLERİ ALANLARA YAZMAK İÇİN VİEW'A YOLLA
        }
Exemplo n.º 4
0
        public async Task Handle(CheckOutEvent command)
        {
            // Search Customer.
            CustomerItem customerItem = _iCustomerServices.GetCustomer(command.CustomerId).Result;

            if (customerItem == null)
            {
                return;
            }

            // Add CheckOut.
            customerItem.AddCheckOut(command.CashDeskSessionName, command.AmountStore, command._CreationDate);

            // Update Db.
            await _iCustomerServices.UpdateCustomerLastCheckOut(customerItem.Id, customerItem);
        }
Exemplo n.º 5
0
 public IActionResult Get(long Id) => Ok(_customerServices.GetCustomer(Id));