Example #1
0
        protected virtual void btnSalvar_Click(object sender, EventArgs e)
        {
            entityManager.Post();

            foreach (Control control in this.Controls)
            {
                if (control.DataBindings.Count > 0)
                {
                    control.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
                }
            }

            ValidateChildren(ValidationConstraints.Visible);

            string messages = string.Empty;

            foreach (string message in entityManager.GetMessagesValidators())
            {
                messages += message + "\n";
            }

            if (messages != string.Empty)
            {
                MessageBoxInformation.Show(this, messages);

                DialogResult = DialogResult.None;
            }
        }