예제 #1
0
        private void btnLocalizar_Click(object sender, RoutedEventArgs e)
        {
            var pesquisa = new frmPesquisarCliente();

            pesquisa.ShowDialog();

            ClientePesquisa = pesquisa.clienteId;
            // Se vier 0, então a pessoa fechou sem escolher nenhum item. Então ele não vai fazer nada.
            if (ClientePesquisa != 0)
            {
                Cliente cliente = clienteDAO.BuscarClientePeloId(ClientePesquisa);
                PopularCamposPeloCliente(cliente);
                MudarOperacao(2);
            }
        }
예제 #2
0
        /*
         * ___  ___            _         _              _        ______                   _         _
         * |  \/  |           | |       | |            | |       | ___ \                 | |       | |
         * | .  . |  ___    __| | _   _ | |  ___     __| |  ___  | |_/ / _ __   ___    __| | _   _ | |_   ___
         * | |\/| | / _ \  / _` || | | || | / _ \   / _` | / _ \ |  __/ | '__| / _ \  / _` || | | || __| / _ \
         * | |  | || (_) || (_| || |_| || || (_) | | (_| ||  __/ | |    | |   | (_) || (_| || |_| || |_ | (_) |
         * \_|  |_/ \___/  \__,_| \__,_||_| \___/   \__,_| \___| \_|    |_|    \___/  \__,_| \__,_| \__| \___/
         */

        /**
         * Quando se clica duas vezes no campo de ID do Fornecedor
         */
        private void TxtClienteID_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var pesquisa = new frmPesquisarCliente();

            pesquisa.ShowDialog();
            IdCliente = pesquisa.clienteId;
            if (IdCliente != 0)
            {
                clienteVenda        = clienteDAO.BuscarClientePeloId(IdCliente);
                txtClienteID.Text   = clienteVenda.Id.ToString();
                txtClienteNome.Text = clienteVenda.Nome;
            }
            else
            {
                WPFUtils.MostrarCaixaDeTextoDeErro("Nenhum cliente escolhido!");
                clienteVenda = null;
                txtClienteID.Clear();
                txtClienteNome.Clear();
            }
        }