Ejemplo n.º 1
0
        //TODO Nadpisz adres
        public void AddAddress()
        {
            AddressManager manager = new AddressManager();
            Address        add     = new Address("test", 1234, Street, City, PostalCode);

            AddressModel = add;
            manager.Create(add);
        }
Ejemplo n.º 2
0
        private async void InsertAddress_OnClick(object sender, RoutedEventArgs e)
        {
            var selectedPerson = ContactsList.SelectedItem as Person;

            if (selectedPerson != null)
            {
                var a = await _addressManager.Create(new Address(Address.Text, selectedPerson.Id));

                AddressList.Items.Add(a);
            }
        }
Ejemplo n.º 3
0
        // POST
        // CREATE
        public IHttpActionResult Post(Address address)
        {
            try
            {
                var mng = new AddressManager();
                mng.Create(address);

                apiResp         = new ApiResponse();
                apiResp.Message = "Action was executed.";

                return(Ok(apiResp));
            }
            catch (BussinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-"
                                                         + bex.AppMessage.Message)));
            }
        }
Ejemplo n.º 4
0
 public ActionResult <AddressDTO> Create([FromBody] AddressCreateDTO userInput)
 {
     try { return(_addressManager.Create(userInput)); }
     catch (BaseCustomException ex) { return(BadRequest(ex.Message)); }
 }