Beispiel #1
0
        private void InjectServices()
        {
            var service = new TextBoxValidator();

            NewContactPanel.InjectService(service);
            UpdateContactPanel.InjectService(service);
        }
Beispiel #2
0
 private void AddUpdateContactPanel()
 {
     UpdateContactPanel                  = new UpdateContactPanel();
     UpdateContactPanel.Dock             = DockStyle.Fill;
     UpdateContactPanel.Visible          = false;
     UpdateContactPanel.OnContactAdding += this.UpdateContactPanelOnContactAdding;
     UserViewPanel.Controls.Add(UpdateContactPanel);
 }
Beispiel #3
0
        private void LoadUpdateInformation()
        {
            int id       = ViewContactPanel.SelectedID;
            var toUpdate = Contacts.Tables["Contact"]
                           .AsEnumerable()
                           .Where(contact => contact.Field <int>("id") == id)
                           .First();

            UpdateContactPanel.LoadContact(toUpdate);
        }
Beispiel #4
0
        private void UpdateContactPanelOnContactAdding(object sender, EventArgs e)
        {
            var errors = Validator.FindInputErrors(UpdateContactPanel.Inputs);

            if (errors.Length > 0)
            {
                UpdateContactPanel.ShowInvalidFields(errors);
            }
            else
            {
                UpdateContact();
                ViewContactPanel.CollapseEditPanel();
                UpdateContactPanel.Reset();
                UpdateContactPanel.Visible = false;
            }
        }