public Motorista(Motorista motorista_antigo)
 {
     this.ID         = new Frase(motorista_antigo.ID);
     this.Nome       = new Frase(motorista_antigo.Nome);
     this.Ascendente = motorista_antigo.Ascendente;
     this.Ordenacao  = motorista_antigo.Ordenacao;
 }
Exemple #2
0
        public void EditarMotorista(bool enabled)
        {
            isEdicao = true;
            gboxMotorista.Enabled = enabled;

            motoristaGUI = new Controlador.Motorista(fachada.CarregarMotorista(controladorSelecionado, painelSelecionado, indiceMotorista));

            tboxID.Text   = motoristaGUI.ID.LabelFrase;
            tboxNome.Text = motoristaGUI.Nome.LabelFrase;
        }
        public bool AchouID(Motorista m1, Motorista m2)
        {
            bool achou = false;

            if (m1.ID.LabelFrase == m2.ID.LabelFrase)
            {
                achou = true;
            }

            return(achou);
        }
Exemple #4
0
 private void CarregarMotoristaParametroVariavel()
 {
     indiceMotParmVariavel = fachada.RetornarParamVariavelMotoristaSelecionado(controladorSelecionado);
     if (indiceMotParmVariavel <= listaMotorista.Count && listaMotorista.Count > 0)
     {
         motoristaParamVariavel = fachada.CarregarMotorista(controladorSelecionado, painelSelecionado, indiceMotParmVariavel);
     }
     else
     {
         motoristaParamVariavel = null;
         indiceMotParmVariavel  = 0;
     }
 }
Exemple #5
0
        private void NovoMotorista(bool enabled)
        {
            isEdicao = false;
            gboxMotorista.Enabled = enabled;

            motoristaGUI            = new Controlador.Motorista(rm.GetString("USER_CONTROL_LISTAR_MOTORISTA_NOVO_ID"), rm.GetString("USER_CONTROL_LISTAR_MOTORISTA_NOVO_NOME"));
            motoristaGUI.Ordenacao  = colunaOrdenacao;
            motoristaGUI.Ascendente = ordenacaoAscendente;

            //setar a fonte padrao para o tamanho do painel
            fachada.SetarFontesDefaultFrases(motoristaGUI.ID, fachada.GetAlturaPainel(controladorSelecionado, painelSelecionado));
            fachada.SetarFontesDefaultFrases(motoristaGUI.Nome, fachada.GetAlturaPainel(controladorSelecionado, painelSelecionado));

            tboxID.Text   = motoristaGUI.ID.LabelFrase;
            tboxNome.Text = motoristaGUI.Nome.LabelFrase;
        }
Exemple #6
0
        public Boolean exibirErro(bool setarCampo)
        {
            if (tbID.Text == "")
            {
                MessageBox.Show(rm.GetString("USER_CONTROL_LISTAR_MOTORISTA_MBOX_ID_VAZIO"));
                if (setarCampo)
                {
                    modeloTexto.SetarTexto();
                }
                return(true);
            }

            if (tbNome.Text == "")
            {
                MessageBox.Show(rm.GetString("USER_CONTROL_LISTAR_MOTORISTA_MBOX_NOME_VAZIO"));
                if (setarCampo)
                {
                    modeloTexto.SetarTexto();
                }
                return(true);
            }

            Controlador.Motorista motTemp = new Controlador.Motorista(this.Motoristas.motoristaGUI);
            if (isID)
            {
                motTemp.ID = fraseGUI;
            }
            else
            {
                motTemp.Nome = fraseGUI;
            }

            if (fachada.AchouMotoristaID(controladorSelecionado, this.Motoristas.indiceMotorista, this.Motoristas.isEdicao, motTemp))
            {
                MessageBox.Show(rm.GetString("USER_CONTROL_LISTAR_MOTORISTA_MBOX_MESMO_ID"));
                if (setarCampo)
                {
                    modeloTexto.SetarTexto();
                }
                return(true);
            }

            return(false);
        }
        public bool CompararObjetosMotoristas(Motorista m1, Motorista m2)
        {
            bool alterou = false;

            if (m1.ID.CompararObjetosFrase(m1.ID, m2.ID))
            {
                alterou = true;
            }


            if (!alterou)
            {
                if (m1.Nome.CompararObjetosFrase(m1.Nome, m2.Nome))
                {
                    alterou = true;
                }
            }

            return(alterou);
        }
Exemple #8
0
 public void CarregarMotoristaGUI()
 {
     motoristaGUI = new Controlador.Motorista(fachada.CarregarMotorista(controladorSelecionado, painelSelecionado, indiceMotorista));
 }