Exemplo n.º 1
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (txtAddress.Text != "" &&
                txtCity.Text != "" &&
                txtZip.Text != "")
            {
                address.Address = txtAddress.Text;
                address.City    = txtCity.Text;
                address.StateId = cboState.SelectedIndex + 1;
                address.ZipCode = txtZip.Text;

                int result = UserAddressManager.Update(address);

                if (result >= 1)
                {
                    MessageBox.Show("Address updated.");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("An error occurred when updating.");
                }
            }
            else
            {
                MessageBox.Show("Error. Please enter data into the fields.");
            }
        }
Exemplo n.º 2
0
        public void UpdateTest()
        {
            List <UserAddress> addresss = UserAddressManager.Load();
            UserAddress        address  = addresss.Where(c => c.City == "OshkoshTest").FirstOrDefault();

            address.City = "OshkoshTest2";
            int actual = UserAddressManager.Update(address);

            Assert.IsTrue(actual > 0);
        }
Exemplo n.º 3
0
 // PUT: api/UserAddress/5
 public void Put(Guid id, [FromBody] UserAddress make)
 {
     UserAddressManager.Update(make);
 }