Ejemplo n.º 1
0
        private void listBox_procura_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int _Index = listBox_procura.IndexFromPoint(e.Location);

            if (_Index != ListBox.NoMatches)
            {
                if (radioButton_encomendas.Checked == true)
                {
                    new Encomenda(Convert.ToInt32(_Database.Select("Encomendas_Telefone", "ID", $"Nome = '{listBox_procura.Text}'")[0])).Show();
                }
                else if (radioButton_produtos.Checked == true)
                {
                    new Produto(Convert.ToInt32(_Database.Select("Produtos", "ID", $"Nome = '{listBox_procura.Text}'")[0])).Show();
                }
                else if (radioButton_funcionarios.Checked == true)
                {
                    string _IdFuncionario = _Database.Select("Funcionarios", "ID", $"Nome = '{listBox_procura.Text}'")[0];

                    if (!_Form.IsOpen("Perfil"))
                    {
                        new Perfil(Convert.ToInt32(_IdFuncionario)).Show();
                    }
                    else
                    {
                        MessageBox.Show("Já existe um perfil aberto.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 // # ================================================================================================ #
 private void _ButtonVerEncomendaClick(object _Sender, EventArgs _Event, int _IdEncomenda)
 {
     try
     {
         if (!_Form.IsOpen("Encomenda"))
         {
             new Encomenda(_IdEncomenda).Show();
         }
         else
         {
             MessageBox.Show("Já existe um formulário de edição de encomendas aberto.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch (Exception _Exception)
     {
         _Scripts7.Exception(_Exception);
     }
 }