Beispiel #1
0
        private void Btn_agregar_Click(object sender, RoutedEventArgs e)
        {
            if (txt_direccion.Text != String.Empty && cb_region.Text != String.Empty && cb_comuna.Text != String.Empty)
            {
                Direccion dir = new Direccion()
                {
                    ID_DIRECCION = id,
                    DIRECCION1   = txt_direccion.Text,
                    ID_COMUNA    = (short)cb_comuna.SelectedValue,
                    ID_EMPRESA   = empresa
                };

                if (dir.Update())
                {
                    MessageBoxResult exito = MessageBox.Show("Se modificó la dirección de la empresa", "Éxito",
                                                             MessageBoxButton.OK, MessageBoxImage.Information);
                }

                else
                {
                    MessageBoxResult mal = MessageBox.Show("No se pudo modificar la dirección", "Error",
                                                           MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }

            else
            {
                MessageBoxResult mal = MessageBox.Show("Debe llenar todos los campos", "Error",
                                                       MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }