private void UpdateEditingSidebar(string[] newData)
        {
            if (mode == contactString)
            {
                if (contactEditing is null)
                {
                    contactEditing = new DataEditingSidebar(contactsColumns, "Contact", this);
                }
                if (contactAdding is null)
                {
                    contactAdding = new DataEditingSidebar(contactsColumns, "Contact", this);
                }
                contactEditing.ChangeSelectedData(newData);
                contactAdding.StartAddNew(GetClientID());
                dtgDogs.UpdateSelectedIndex(-1);
                dtgClients.UpdateSelectedIndex(-1);
            }
            else if (mode == dogString)
            {
                if (dogsEditing is null)
                {
                    dogsEditing = new DataEditingSidebar(dogsColumns, "Dog", this);
                }
                if (dogsAdding is null)
                {
                    dogsAdding = new DataEditingSidebar(dogsColumns, "Dog", this);
                }
                dogsEditing.ChangeSelectedData(newData);
                dogsAdding.StartAddNew(GetClientID());
                dtgContacts.UpdateSelectedIndex(-1);
                dtgClients.UpdateSelectedIndex(-1);
            }
            else if (mode == clientString)
            {
                if (clientsEditing is null)
                {
                    clientsEditing = new DataEditingSidebar(clientsColumns, "Client", this);
                }
                if (clientsAdding is null)
                {
                    clientsAdding = new DataEditingSidebar(clientsColumns, "Client", this);
                }
                clientsEditing.ChangeSelectedData(newData);
                clientsAdding.StartAddNew(GetClientID());
                dtgDogs.UpdateSelectedIndex(-1);
                dtgContacts.UpdateSelectedIndex(-1);
            }

            UpdateClientEditor();
        }
Esempio n. 2
0
 public void TableSelectionChanged(string[] newData)
 {
     editingSidebar.ChangeSelectedData(newData);
 }