예제 #1
0
        private void btBuscar_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client = new AmazonDynamoDBClient();

            DynamoDBContext context = new DynamoDBContext(client);

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaFuncionarios(context, idFunconario.Text, nomeFuncionario.Text);

            try
            {
                if (idFunconario.Text != "" && nomeFuncionario.Text == "")
                {
                    nomeFuncionario.Text = ComandoAWS.SearchFuncionarios(context , "id", idFunconario.Text, "nome");

                }
            }

            catch
            {

            }

            idFunconario.Clear();
            nomeFuncionario.Clear();

        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, "", "", "", "", "", "");
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
                DynamoDBContext      context = new DynamoDBContext(client);

                String loginConfirm = ComandoAWS.VerificacaoLogin(context, "admin", password.Text);


                if (loginConfirm == "admin")
                {
                    InterfaceAddUser interfaceAddUser = new InterfaceAddUser();
                    interfaceAddUser.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Senha Incorreta!");
                    this.Close();
                }
            }

            catch
            {
                this.Close();
            }
        }
예제 #4
0
        public List <String> getRotaFuncionario(String idFuncionario)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            IEnumerable <Servicos> rotaOrdemServico     = ComandoAWS.SearchDataTabelaServicos(context, "", idFuncionario, "", "", "", "");
            List <Servicos>        rotaOrdemServicoList = rotaOrdemServico.ToList();

            List <String> rota = new List <string>();

            int j = 0;

            for (int i = 0; i < rotaOrdemServicoList.Count(); i++)
            {
                if (rotaOrdemServicoList[i].status == "aguardando retirada")
                {
                    String conversaoEnderecoRota = Convert.ToString(rotaOrdemServicoList[i].enderecoDestinatario);
                    rota.Insert(j, conversaoEnderecoRota);
                    j++;

                    Console.WriteLine("teste:" + rota);
                }
            }
            return(this.apiTracaRota(criaOrigem(), this.conversaoListaStringEnderecos(rota), criaKey()));
        }
예제 #5
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex != -1)
     {
         AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
         DynamoDBContext      context = new DynamoDBContext(client);
         idFuncionario.Text = ComandoAWS.SearchFuncionarios(context, "nome", comboBox1.SelectedItem.ToString(), "id");
     }
 }
        private void btBuscar_Click(object sender, System.EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaCidades(context, cidadeDestinatario.Text, idFuncionario.Text);

            cidadeDestinatario.Clear();
            idFuncionario.Clear();
            comboBox1.SelectedIndex = -1;
        }
예제 #7
0
        private void comboBox1_DropDown(object sender, System.EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            comboBox1.Items.Clear();

            List <Funcionarios> asList = ComandoAWS.SearchDataTabelaFuncionarios(context, "", "");

            for (int i = 0; i < asList.Count(); i++)
            {
                comboBox1.Items.Add(asList[i].nome);
            }
        }
예제 #8
0
        private void comboBox3_DropDown(object sender, System.EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            comboBox1.Items.Clear();

            List <Servicos> asList = ComandoAWS.SearchDataTabelaServicos(context, "", "", "", "", "", "");

            for (int i = 0; i < asList.Count(); i++)
            {
                if (!comboBox3.Items.Contains(asList[i].status))
                {
                    comboBox3.Items.Add(asList[i].status);
                }
            }
        }
        private void btDeletar(object sender, System.EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            try
            {
                ComandoAWS.DeleteCity(context, cidadeDestinatario.Text, idFuncionario.Text);
            }

            catch
            {
                MessageBox.Show("Falha Conexão ou não existente!");
            }

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaCidades(context, "", "");
        }
예제 #10
0
        private void button2_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            try
            {
                ComandoAWS.DeleteUser(context, user.Text);
                MessageBox.Show("Usuário Deletado");
                this.Close();
            }

            catch
            {
                MessageBox.Show("Erro ao deletar Usuario");
                this.Close();
            }
        }
        private void btCadastrar_Click(object sender, System.EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            try
            {
                ComandoAWS.AddCity(context, cidadeDestinatario.Text, idFuncionario.Text);
            }

            catch
            {
                MessageBox.Show("Erro no cadastro da cidade");
            }


            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaCidades(context, "", "");
        }
예제 #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Multiselect = true;
            openFileDialog.Filter      = "xml files (*.xml)|*.xml";
            openFileDialog.ShowDialog();

            LeituraNotaFiscal leituraNotaFiscal = new LeituraNotaFiscal();

            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            progressBar1.Value = 0;

            for (int i = 0; i < openFileDialog.FileNames.Count(); i++)
            {
                progressBar1.Maximum = openFileDialog.FileNames.Count() - 1;

                String caminho = openFileDialog.FileNames[i].ToString();

                String nrNotaEntrega           = leituraNotaFiscal.LeituraNrNota(caminho);
                String idMotorista             = ComandoAWS.SearchCidades(context, "cidadeDestinatario", leituraNotaFiscal.LeituraCidadeDestinatario(caminho), "id");
                String nomeDestinatarioEntrega = leituraNotaFiscal.LeituraNomeDestinatario(caminho);
                String remetenteEntrega        = leituraNotaFiscal.LeituraCidadeRemetente(caminho);
                String destinatarioEntrega     = leituraNotaFiscal.LeituraCidadeDestinatario(caminho);
                String enderecoDestinatario    = leituraNotaFiscal.LeituraEnderecoDestinatario(caminho);
                String status = "Aguardando Retirada";

                try
                {
                    ComandoAWS.AddJob(context, nrNotaEntrega, idMotorista, nomeDestinatarioEntrega, enderecoDestinatario, destinatarioEntrega, status);
                }

                catch
                {
                    MessageBox.Show("Falha ao salvar!");
                }
                progressBar1.Value = i;
            }

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, "", "", "", "", "", "");
        }
예제 #13
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client = new AmazonDynamoDBClient();
            DynamoDBContext context = new DynamoDBContext(client);

            try
            {
                ComandoAWS.DeleteEmployer(context, idFunconario.Text, nomeFuncionario.Text);

            }

            catch
            {
                MessageBox.Show("Falha Conexão ou não existente!");
            }

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaFuncionarios(context, "", "");

        }
예제 #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client = new AmazonDynamoDBClient();

            DynamoDBContext context = new DynamoDBContext(client);

            try
            {
                ComandoAWS.AddEmployer(context, idFunconario.Text, nomeFuncionario.Text);
            }

            catch
            {
                Console.WriteLine("Erro no cadastro do Funcionario");
            }

            dataGridView1.DataSource = ComandoAWS.SearchDataTabelaFuncionarios(context, "", "");


        }
예제 #15
0
        private void button1_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            String loginConfirm = ComandoAWS.VerificacaoLogin(context, user.Text, password.Text);

            if (loginConfirm != "nok")
            {
                GlobalVariables.usuarioLogin = loginConfirm;
                MenuPrincipal menuPrincipal = new MenuPrincipal();
                menuPrincipal.Show();
                this.Hide();
            }

            else
            {
                MessageBox.Show("Usuário ou senha incorreto!");
            }
        }
예제 #16
0
        private void button2_Click(object sender, EventArgs e)
        {
            AmazonDynamoDBClient client  = new AmazonDynamoDBClient();
            DynamoDBContext      context = new DynamoDBContext(client);

            try
            {
                if (idFuncionario.Text != "")
                {
                    dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, "", idFuncionario.Text, "", "", "", "");
                }
                else if (cidadeDestinatario.Text != "")
                {
                    dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, "", "", cidadeDestinatario.Text, "", "", "");
                }
                else if (xml.Text != "")
                {
                    dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, xml.Text, "", "", "", "", "");
                }
                else
                {
                    dataGridView1.DataSource = ComandoAWS.SearchDataTabelaServicos(context, "", "", "", "", "", "");
                }

                idFuncionario.Clear();
                cidadeDestinatario.Clear();
                status.Clear();
                comboBox1.SelectedIndex = -1;
                comboBox2.SelectedIndex = -1;
                comboBox3.SelectedIndex = -1;
            }



            catch
            {
                Console.WriteLine("Erro na busca!");
            }
        }