예제 #1
0
        private void funcAddCustomer()
        {
            //?? : CustomerID
            //Insert straight to the server and then sync to local is better option

            Models.Customer aCustomer = new Models.Customer();
            aCustomer.Name    = Name;
            aCustomer.Address = Address;
            aCustomer.Phone   = Phone;
            customerDb.InsertCustomer(aCustomer);

            Close(this);
        }
예제 #2
0
        public IActionResult AddCustomer([FromBody] Customer costumer)
        {
            try
            {
                _customerDatabase.InsertCustomer(costumer.FirstName, costumer.Surname, costumer.Email, costumer.Address, costumer.City, costumer.Country);
                _notificationServiceClient.PublishNotificationInfo($"Customer {costumer.FirstName} {costumer.Surname} was successfully inserted!");
            }
            catch (BaseMicroserviceException ex)
            {
                return(ex.ToActionResult());
            }

            return(new OkResult());
        }