Пример #1
0
        private void UCQuartoLeito_Load(object sender, EventArgs e)
        {
            new ToolTip()
            {
                UseAnimation = true, IsBalloon = false,
            }.SetToolTip(buttonLimpar, "Limpar Pesquisa");
            new ToolTip()
            {
                UseAnimation = true, IsBalloon = false,
            }.SetToolTip(button1, "Limpar Pesquisa");


            comboBoxQuarto.SelectedIndexChanged         -= comboBoxQuarto_SelectedIndexChanged;
            comboBoxPesquisaQuarto.SelectedIndexChanged -= comboBoxPesquisaQuarto_SelectedIndexChanged;
            FrmMain.mySalvar.Click += MySalvar_Click;
            FrmMain.myNovo.Click   += MyNovo_Click;
            presenterQuarto         = new QuartoPresenter(this);
            presenterQuarto.Carregar();

            presenterLeito = new LeitoPresenter(this);
            presenterLeito.Carregar();
            comboBoxQuarto.SelectedIndexChanged         += comboBoxQuarto_SelectedIndexChanged;
            comboBoxPesquisaQuarto.SelectedIndexChanged += comboBoxPesquisaQuarto_SelectedIndexChanged;
            PopulaOcupacoes();
            textBoxNomeQuarto.Focus();
        }
Пример #2
0
        private void textBoxPesquisaLeito_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (textBoxPesquisaLeito.Text.Length >= 3)
                {
                    presenterLeito = new LeitoPresenter(this);
                    presenterLeito.Carregar(new Leito {
                        NomeLeito = textBoxPesquisaLeito.Text.Trim()
                    });
                }

                if (textBoxPesquisaLeito.Text.Length == 0)
                {
                    presenterLeito = new LeitoPresenter(this);
                    presenterLeito.Carregar();
                }
            }
            catch (Exception exC)
            {
                throw new Exception("Erro ao tentar pesquisar quarto: " + exC.Message);
            }
        }