Esempio n. 1
0
        private void ButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            GetAll_CountryCodes_Record selected_record = dataGrid.SelectedItem as GetAll_CountryCodes_Record;

            if (selected_record == null)
            {
                return;
            }

            EditCountryViewModel edit_model = new EditCountryViewModel
            {
                Mode          = EditCountryViewModel.ModelMode.Edit,
                CountryCodeID = selected_record.CountryCodeID
            };

            EditCountryWindow window = new EditCountryWindow(edit_model);

            window.Owner = this;
            window.ShowDialog();

            if (window.DialogResult == false)
            {
                return;
            }

            // Refresh the country name is the DataGrid.
            selected_record.Name = edit_model.Name;
        }
Esempio n. 2
0
        private void DoLookupShippingCountryCode()
        {
            GetAll_CountryCodes_Record record = dataGrid.SelectedItem as GetAll_CountryCodes_Record;

            if (record == null)
            {
                return;
            }

            ViewModel.Output_CountryCodeID = record.CountryCodeID;

            DialogResult = true;
        }
Esempio n. 3
0
        public ListCountryWindow(ListCountryViewModel view_model)
        {
            ViewModel = view_model;

            InitializeComponent();

            //ViewModel.Mode
            ViewModel.CountriesRS.ExecSql();

            GetAll_CountryCodes_Record record = ViewModel.CountriesRS.Find(a => a.CountryCodeID == ViewModel.Input_CountryCodeID);

            if (record != null)
            {
                dataGrid.SelectedItem = record; // werkt nog niet
            }
            Loaded += CountriesWindow_Loaded;
        }