Exemple #1
0
        private void Button2_Click(object sender, EventArgs e)
        {
            String nome  = txtNomeUser.Text;
            String senha = txtSenha.Text;
            String tipo  = logarcomo.Text;

            if (nome == "" || senha == "" || tipo == "")
            {
                MessageBox.Show("Por favor preencha todos os Campos!");
                txtNomeUser.Focus();
            }
            else
            {
                if (tipo.Equals("Cliente"))
                {
                    Principal principal = new Principal();

                    cliente client = new cliente();

                    if (client.Login(nome, senha))
                    {
                        MessageBox.Show("CLIENTE: LOGADO COM SUCESSO");
                        Principal p = new Principal();
                        p.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Houve um erro ao logar!!");
                    }
                }
                else if (tipo.Equals("MotoBoy"))
                {
                    TelaMotoboy tlmotoboy = new TelaMotoboy();

                    motoboy mot = new motoboy();

                    if (mot.Login(nome, senha))
                    {
                        MessageBox.Show("MOTOBOY: LOGADO COM SUCESSO");
                        //TelaMotoboy tlmotoboy = new TelaMotoboy();
                        tlmotoboy.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Houve um erro ao logar!!");
                    }
                }
                else
                {
                    MessageBox.Show("Verifique o tipo de conta");
                }
            }
        }
Exemple #2
0
        private void Button1_Click_1(object sender, EventArgs e)
        {
            motoboy boy = new motoboy();

            boy = motoboys[listBox1.SelectedIndex];


            corrida2 corrida2 = new corrida2(boy.Cnh, boy.Nome);

            corrida2.Show();
            this.Hide();



            motoboy mot = new motoboy();
        }
Exemple #3
0
        private void TelaMotoboy_Load(object sender, EventArgs e)
        {
            List <classCorrida> corridas;


            motoboy mot = new motoboy();

            panel1.Controls.Clear();
            int ii = 0;
            int yy = 5;

            string cnh = "";

            foreach (var item in mot.Listar())
            {
                if (item.Usuario.Equals(Session.Nome) && item.Senha.Equals(Session.Senha))
                {
                    cnh = item.Cnh;
                    break;
                }
            }


            classCorrida corri = new classCorrida();

            corridas = corri.select(cnh);

            foreach (var item in corridas)
            {
                PedidosCliente a = new PedidosCliente(item.Id);
                a.Location = new Point(6, (yy));
                yy         = yy + a.Height + 5;
                panel1.Controls.Add(a);
                ii++;
            }
        }