private void TextChanged(object sender, EventArgs e) { if (!FormEvents.IsActive(sender, "TextChanged")) { return; } MakeSQL(); }
public override void EditChanged() { base.EditChanged(); if (!FormEvents.IsActive(this, "EditChanged")) { return; } MakeSQL(); }
public OptionsForm(Settings settings, OnlineSettings onlineSettings, FormEvents buttonActions) { _formEvents = buttonActions; _languageOnForm = new LanguageOnForm(); _settings = settings; _onlineSettings = onlineSettings; InitializeComponent(); InitializeLanguage(); InitializeProperties(); BindButtonEvents(); }
private static void DeclararEventos() { FormEvents.DeclararEventos(BoEventTypes.et_FORM_LOAD, new Dictionary <string, SAPHelper.Form>() { { ((int)FormTypes.OfertaDeCompra).ToString(), new FormOfertaDeCompra() }, { ((int)FormTypes.PedidoDeVenda).ToString(), new FormPedidoDeVenda() }, { ((int)FormTypes.NotaFiscalDeSaida).ToString(), new FormNotaFiscalDeSaida() }, }); _sBOApplication.AppEvent += AppEvent; _sBOApplication.ItemEvent += FormEvents.ItemEvent; }
private void TriggerForm_Load(object sender, EventArgs e) { SetComboBox(); DataToEdit(); SetEnables(); RefreshDependenciesTo(); MakeSQL(); ac = new AutocompleteClass(fctSQL, _dbReg); ac.RefreshAutocompleteForTriggers(); FormEvents.ClearEvents(sender); }
public TriggerForm(Form parent, DBRegistrationClass drc, TreeNode tn, ContextMenuStrip cm, List <TableClass> tables) { FormEvents.DisableEvents(this, "TriggerForm"); InitializeComponent(); this.MdiParent = parent; Tn = tn; TriggerClass tc = (TriggerClass)tn.Tag; Cm = cm; _tables = tables; TriggerObject = tc; OrgTriggerObject = tc; _dbReg = drc; _localNotify.Register4Error(Notify_OnRaiseErrorHandler); _localNotify.Register4Info(Notify_OnRaiseInfoHandler); }
//At some point you could take a look at IoC Containers //It'll take off the responsibility from you to initialize everything in MainForm //And inject every required class. //You'll only need to register them in the IoC Container and then use them just like, // in AspNetCore public MainForm() { InitializeComponent(); _settingsHandler = new SettingsHandler(); _settings = _settingsHandler.LoadSettingsFile() as Settings; _onlineSettings = _settingsHandler.LoadSettingsFile(true) as OnlineSettings; _inboundMessage = new SignalRMessage(); _outgoingMessage = new SignalRMessage(); _clipboardManager = new ClipboardManager(_inboundMessage, _outgoingMessage, _settings); _cloudInteractions = new CloudInteractions(_inboundMessage, _outgoingMessage, _settings, _onlineSettings); _writeHistoryFile = new HistoryFile(_clipboardManager, _settings); _languageOnForm = new LanguageOnForm(); _formEvents = new FormEvents(_clipboardManager, notificationIcon, this, _settings, _writeHistoryFile, _onlineSettings); _startWithWindows = new LaunchOnStartup(_settings); _checkConnection = new CheckStaticConnectionState(Label_Connection_DONOTMODIFY, timer_checkConnection); EnumSetLang(); BindProperties(); BindButtonActions(); }
private static void DeclararEventos() { var eventFilters = new EventFilters(); eventFilters.Add(BoEventTypes.et_MENU_CLICK); try { #region :: Forms Cadastro Básico var formGrupoDeItens = new FormGrupoDeItens(); var formConfiguracaoPeneira = new FormConfiguracaoPeneira(); var formCertificado = new FormCertificado(); var formMetodoFinanceiro = new FormMetodoFinanceiro(); var formModalidade = new FormModalidade(); var formSafra = new FormSafra(); var formTipoOperacao = new FormTipoOperacao(); var formUnidadeComercial = new FormUnidadeComercial(); var formParticipante = new FormParticipante(); var formsCadastroBasico = new List <SAPHelper.Form>() { formGrupoDeItens, formConfiguracaoPeneira, formCertificado, formMetodoFinanceiro, formModalidade, formSafra, formTipoOperacao, formUnidadeComercial, formParticipante }; #endregion #region :: Forms Detalhe de Contrato var formPreContrato = new FormPreContrato(); var formContratoFinal = new FormContratoFinal(); var formPreContratoAberturaPorPeneira = new FormPreContratoAberturaPorPeneira(); var formContratoFinalAberturaPorPeneira = new FormContratoFinalAberturaPorPeneira(); var formPreContratoDetalheCertificado = new FormPreContratoDetalheCertificado(); var formContratoFinalDetalheCertificado = new FormContratoFinalDetalheCertificado(); var formPreContratoComissoes = new FormPreContratoComissoes(); var formContratoFinalComissoes = new FormContratoFinalComissoes(); var formsDetalheContrato = new List <SAPHelper.Form>() { formPreContratoAberturaPorPeneira, formContratoFinalAberturaPorPeneira, formPreContratoDetalheCertificado, formContratoFinalDetalheCertificado, formPreContratoComissoes, formContratoFinalComissoes }; #endregion #region :: Form SAP var formUsuarios = new FormUsuarios(); var formPedidoCompra = new FormPedidoCompra(); var formsPadraoSAP = new List <SAPHelper.Form>() { formUsuarios, formPedidoCompra }; #endregion #region :: Grupos de Forms var formsVisible = new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }; formsVisible.AddRange(formsCadastroBasico); formsVisible.AddRange(formsDetalheContrato); #endregion FormEvents.DeclararEventos(eventFilters, new List <MapEventsToForms>() { new MapEventsToForms(BoEventTypes.et_FORM_VISIBLE, formsVisible), new MapEventsToForms(BoEventTypes.et_FORM_LOAD, formsPadraoSAP), new MapEventsToForms(BoEventTypes.et_COMBO_SELECT, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal, formPreContratoComissoes, formContratoFinalComissoes }), new MapEventsToForms(BoEventTypes.et_VALIDATE, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }), new MapEventsToForms(BoEventTypes.et_CHOOSE_FROM_LIST, new List <SAPHelper.Form>() { formPreContrato, formPreContratoAberturaPorPeneira, formContratoFinal, formContratoFinalAberturaPorPeneira }), new MapEventsToForms(BoEventTypes.et_FORM_DATA_ADD, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal, formCertificado, formMetodoFinanceiro, formModalidade, formSafra, formTipoOperacao, formUnidadeComercial, formParticipante }), new MapEventsToForms(BoEventTypes.et_FORM_DATA_UPDATE, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal, formCertificado, formMetodoFinanceiro, formModalidade, formSafra, formTipoOperacao, formUnidadeComercial, formParticipante }), new MapEventsToForms(BoEventTypes.et_FORM_DATA_LOAD, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }), new MapEventsToForms(BoEventTypes.et_FORM_CLOSE, new List <SAPHelper.Form>() { formPreContratoDetalheCertificado, formPreContratoComissoes, formContratoFinalDetalheCertificado, formContratoFinalComissoes, formContratoFinal }), new MapEventsToForms(BoEventTypes.et_ITEM_PRESSED, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal, formPreContratoAberturaPorPeneira, formPreContratoDetalheCertificado, formPreContratoComissoes, formContratoFinalAberturaPorPeneira, formContratoFinalDetalheCertificado, formContratoFinalComissoes, formGrupoDeItens, formConfiguracaoPeneira, formPedidoCompra }), new MapEventsToForms(BoEventTypes.et_MATRIX_LINK_PRESSED, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }), new MapEventsToForms(BoEventTypes.et_DOUBLE_CLICK, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }), }); var formsAdicionarNovo = new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }; formsAdicionarNovo.AddRange(formsCadastroBasico); FormEvents.DeclararEventosInternos(EventosInternos.AdicionarNovo, formsAdicionarNovo); FormEvents.DeclararEventosInternos(EventosInternos.Pesquisar, new List <SAPHelper.Form>() { formPreContrato, formContratoFinal }); FormEvents.DeclararEventosInternos(EventosInternos.Duplicar, formPedidoCompra); } catch (Exception e) { Dialogs.PopupError("Erro ao declarar eventos de formulário.\nErro: " + e.Message); } try { Global.SBOApplication.SetFilter(eventFilters); } catch (Exception e) { Dialogs.PopupError("Erro ao setar eventos declarados da aplicação.\nErro: " + e.Message); } Global.SBOApplication.AppEvent += AppEvent; Global.SBOApplication.ItemEvent += FormEvents.ItemEvent; Global.SBOApplication.FormDataEvent += FormEvents.FormDataEvent; Global.SBOApplication.MenuEvent += Menu.MenuEvent; }