예제 #1
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            if (listSupplier.Items.Count > 0)
            {
                listSupplier.ScrollIntoView(listSupplier.Items[0]);
            }
            txbAddress.Clear();
            txbIdSup.Clear();
            txbEmail.Clear();
            txbMoreInfo.Clear();
            txbNameSup.Clear();
            txbPhone.Clear();
            btnAdd.IsEnabled    = false;
            btnDelete.IsEnabled = true;
            IconDelete.Kind     = MaterialDesignThemes.Wpf.PackIconKind.ContentSave;
            btnDelete.ToolTip   = "Save";
            btnEdit.IsEnabled   = true;
            IconEdit.Kind       = MaterialDesignThemes.Wpf.PackIconKind.Cancel;
            setTextBox(true);
            txbIdSup.IsEnabled     = false;
            txbIdSup.Text          = manage.Create_NewIdSupplier_Auto();
            listSupplier.IsEnabled = false;

            txbIdSup.Focus();

            if (refreshComboboxSup != null)
            {
                refreshComboboxSup.Invoke(true);
            }
        }