Пример #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;
            }
        }
Пример #2
0
 protected virtual void OnAfterDeleteClick(EntityDeleteEventArgs e)
 {
     if (AfterDeleteClick != null)
     {
         AfterDeleteClick(e);
     }
     if (!e.CancelAction && showMessageSucess && !string.IsNullOrEmpty(messageSucess))
     {
         MessageBoxInformation.Show(Parent, messageSucess);
     }
 }
Пример #3
0
        protected override void OnLostFocus(EventArgs e)
        {
            base.OnLostFocus(e);

            if (maxValue > -1 && maxValue < Convert.ToDecimal(this.Text))
            {
                MessageBoxInformation.Show(this, "O número máximo permitido é " + maxValue.ToString());

                this.Focus();
            }
        }
Пример #4
0
        private void setEntityFromControl(EntitySaveEventArgs e)
        {
            try
            {
                SetEntityFromControl.Instance.Execute(e.Entity, Parent);
            }
            catch (PropertyListException E)
            {
                if (ShowMessageExceptions)
                {
                    MessageBoxInformation.Show(Parent, E.Message);
                }
                else
                {
                    throw new PropertyListException(E.PropertyExceptions);
                }

                e.CancelAction = true;
            }
        }