コード例 #1
0
ファイル: FormVereadores.cs プロジェクト: ronaldojf/camara
        private void btCadastar_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.AppStarting;
            this.Refresh();

            RecuperarDadosTextBox();

            if (this.vereador.Save())
            {
                btLimpar_Click(sender, e);
                Decorator.MessageBoxSuccess("Registro criado com sucesso!");

                if (this.formProjetos != null)
                {
                    this.formProjetos.RefreshVereadores();
                }
            }
            else if (this.vereador.HasErrorsOn("criar"))
            {
                Decorator.MessageBoxError(this.vereador.ShowMessage("criar"));
            }

            AlternarFormErros();
            this.ActiveControl = txNome;
            this.Cursor        = Cursors.Default;
        }
コード例 #2
0
ファイル: FormPartido.cs プロジェクト: ronaldojf/camara
        private void btCadastar_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.AppStarting;
            this.Refresh();

            RecuperarDadosTextbox();

            if (this.partido.Save())
            {
                btLimpar_Click(sender, e);
                Decorator.MessageBoxSuccess("Registro criado com sucesso!");

                if (formVereadores != null)
                {
                    formVereadores.AtualizarPartidos();
                }
            }
            else if (this.partido.HasErrorsOn("criar"))
            {
                Decorator.MessageBoxError(this.partido.ShowMessage("criar"));
            }

            AlternarFormErros();
            Decorator.FocusOnFirstTextBox(pnContent.Controls);
        }