static void Main(string[] args) { var appAluno = new AlunoAplicacao(); Console.Write("Digite o nome do aluno: "); string nome = Console.ReadLine(); Console.Write("Digite o nome da mãe do aluno: "); string mae = Console.ReadLine(); Console.Write("Digite a data de nascimento do aluno: "); string data = Console.ReadLine(); var aluno1 = new Aluno { Nome = nome, Mae = mae, DataNascimento = DateTime.Parse(data) }; appAluno.Salvar(aluno1); var dados = appAluno.ListarTodos(); foreach (var aluno in dados) { Console.WriteLine("Id:{0}, Nome:{1}, Mae:{2}, DataNascimento:{3}", aluno.Id, aluno.Nome, aluno.Mae, aluno.DataNascimento); } }
public Presenca(Aula aula, Aluno aluno, string statusPresenca) : this() { this.Aula = aula; this.Aluno = aluno; this.StatusPresenca = statusPresenca; }
static void Main(string[] args) { try { var appAluno = AlunoAplicacaoConstrutor.AlunoAplicacaoADO(); Console.Write("Digite o nome do aluno: "); string nome = Console.ReadLine(); Console.Write("Digite o nome da mãe do aluno: "); string mae = Console.ReadLine(); Console.Write("Digite a data de nascimento do aluno: "); string data = Console.ReadLine(); //Data formato americano var aluno = new Aluno() { Nome = nome, Mae = mae, DataNascimento = Convert.ToDateTime(data) }; appAluno.Salvar(aluno); foreach (var aluno1 in appAluno.ListarTodos()) { Console.WriteLine("Id: {0}, Nome: {1}, Mãe: {2}, Mãe: DataNascimento: {3}", aluno1.Id, aluno1.Nome, aluno1.Mae, aluno1.DataNascimento); } } catch (Exception ex) { Console.Write("Erro: " + ex.Message); } Console.Read(); }
public Pagamento(int pId, float pValor, Status pStatus, Mes pMes, Aluno pAluno) { id = pId; valor = pValor; status = pStatus; mes = pMes; aluno = pAluno; }
public Aluno AtualizarAluno(Aluno aluno) { using (MyCompanyContext db = new MyCompanyContext()) { db.Entry(aluno).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return aluno; } }
public Aluno CriarAluno(Aluno aluno) { using (MyCompanyContext db = new MyCompanyContext()) { db.Aluno.Add(aluno); db.SaveChanges(); return aluno; } }
public void Alterar(Aluno aluno) { try { Aluno alunoAux = new Aluno(); alunoAux.ID = aluno.ID; List<Aluno> resultado = this.Consultar(alunoAux, TipoPesquisa.E); if (resultado == null || resultado.Count == 0) throw new AlunoNaoAlteradoExcecao(); alunoAux = resultado[0]; alunoAux.Alergico = aluno.Alergico; alunoAux.Bairro = aluno.Bairro; alunoAux.Cep = aluno.Cep; alunoAux.Cidade = aluno.Cidade; alunoAux.ComplementoEndereco = aluno.ComplementoEndereco; alunoAux.Contato = aluno.Contato; alunoAux.DescricaoMedica = aluno.DescricaoMedica; alunoAux.Email = aluno.Email; alunoAux.FatorRh = aluno.FatorRh; alunoAux.FoneAluno = aluno.FoneAluno; alunoAux.FoneEmergencia = aluno.FoneEmergencia; alunoAux.FoneMedico = aluno.FoneMedico; alunoAux.FoneResidencia = aluno.FoneResidencia; alunoAux.GrupoSanguineo = aluno.GrupoSanguineo; alunoAux.Hospital = aluno.Hospital; alunoAux.Imagem = aluno.Imagem; alunoAux.Login = aluno.Login; alunoAux.Logradouro = aluno.Logradouro; alunoAux.Nacionalidade = aluno.Nacionalidade; alunoAux.Nascimento = aluno.Nascimento; alunoAux.Naturalidade = aluno.Naturalidade; alunoAux.Nome = aluno.Nome; alunoAux.NomeMedico = aluno.NomeMedico; alunoAux.PerfilID = aluno.PerfilID; alunoAux.PlanoSaude = aluno.PlanoSaude; alunoAux.Senha = aluno.Senha; alunoAux.Sexo = aluno.Sexo; alunoAux.SituacaoEspecial = aluno.SituacaoEspecial; alunoAux.Status = aluno.Status; alunoAux.Uf = aluno.Uf; alunoAux.SerieAtual = aluno.SerieAtual; alunoAux.Edificio = aluno.Edificio; Confirmar(); } catch (Exception) { throw new AlunoNaoAlteradoExcecao(); } }
public void Salvar(Aluno aluno) { if (aluno.Id > 0) { Alterar(aluno); } else { Inserir(aluno); } }
public void Insere(Aluno aluno) { using (OdbcConnection conexao = ConexaoPadrao.CreateConnection()) { string sql = "insert into Aluno(id) values (?, ?, ?, ?, ?)"; OdbcCommand comando = new OdbcCommand(sql, conexao); comando.Parameters.AddWithValue("@nome", aluno.id); conexao.Open(); comando.ExecuteNonQuery(); } }
public void Altera(Aluno aluno) { using (OdbcConnection conexao = ConexaoPadrao.CreateConnection()) { string sql = "update Aluno set [id] = ?"; OdbcCommand comando = new OdbcCommand(sql, conexao); comando.Parameters.AddWithValue("@nome", aluno.id); conexao.Open(); comando.ExecuteNonQuery(); } }
public void Inserir(Aluno aluno) { sql = string.Format(@"INSERT INTO ALUNOS (NOME, CARGO, DATANASCIMENTO) VALUES ('{0}','{1}','{2}')", aluno.Nome, aluno.Cargo, aluno.DataNasc); using (contexto = new Contexto()) { contexto.ExecutaComando(sql); } }
public FormAddAluno(IAlunoRepositorio repositorio, Aluno aluno) : this(repositorio) { editMode = true; _aluno = aluno; cbxTurma.Text = _aluno.Turma.ToString(); txtNome.Text = _aluno.Nome; txtSobrenome.Text = _aluno.Sobrenome; txtIdade.Text = _aluno.Idade.ToString(); txtIdade.Text = _aluno.Nota.ToString(); cbxTurma.Text = _aluno.Status.ToString(); }
/// <summary> /// Distribui os alunos contidos no array "Aluno[] alunosRandomizados" nas listas /// contidas no array de "List<Aluno> lista". /// </summary> /// <param name="qntGrupo">Recebe a quantidade de listas existentes.</param> /// <param name="alunosRandomizados">Recebe um array contendo os alunos randomizados pelo /// método "AlunoOperation.RandomizarAlunos".</param> /// <param name="lista">Recebe o array de listas de alunos para distribuição dos alunos /// contidos em "alunosRandomizados".</param> private static void DistribuirAlunos(int qntGrupo, Aluno[] alunosRandomizados, List<Aluno>[] lista) { int count = 0; foreach (Aluno termo in alunosRandomizados) { lista[count].Add(termo); count++; if (count == qntGrupo) { count = 0; } } }
public frmMatriculaControlar(Usuario user) { InitializeComponent(); status = "Ambas"; formapgmto = "Ambas"; this.user = user; mat = new Matricula(); mod = new Modalidade(); alu = new Aluno(); rbAtivasInativas.Checked = true; rbDiaristaMensalista.Checked = true; btnBuscar_Click(this, null); atualizaInfos(); }
public void Add(AlunoDTO alunoDto) { Turma turma = _turmaRepository.GetById(alunoDto.TurmaId); Aluno aluno = new Aluno(alunoDto.Descricao.Split(':')[0], turma??new Turma(2007));//todo: turma vem null aluno.Endereco.Bairro = alunoDto.Bairro; aluno.Endereco.Cep = alunoDto.Cep; aluno.Endereco.Localidade = alunoDto.Localidade; aluno.Endereco.Uf = alunoDto.Uf; _alunoRepository.Add(aluno); _unitOfWork.Commit(); }
public void Alterar(Aluno aluno) { StringBuilder _sql = new StringBuilder(); _sql.Append("UPDATE ALUNOS SET "); _sql.Append(String.Format(" NOME = '{0}', ", aluno.Nome)); _sql.Append(String.Format(" CARGO = '{0}', ", aluno.Cargo)); _sql.Append(String.Format(" DATANASCIMENTO = '{0}' ", aluno.DataNasc)); _sql.Append(String.Format(" WHERE ALUNOID = {0}", aluno.Id)); using (contexto = new Contexto()) { contexto.ExecutaComando(_sql.ToString()); } }
private List<Aluno> TranformaReaderEmLista(SqlDataReader reader) { var lista = new List<Aluno>(); while (reader.Read()) { Aluno aluno = new Aluno() { Id = Convert.ToInt32(reader["AlunoId"]), Nome = reader["nome"].ToString(), Cargo = reader["cargo"].ToString(), DataNasc = Convert.ToDateTime(reader["DataNascimento"]) }; lista.Add(aluno); } reader.Close(); return lista; }
/// <summary> /// Realiza a "randomização" dos alunos inseridos pelo método "AdicionarAluno()". /// </summary> /// <returns>Retorna um array com os termos da lista de alunos "RelacaoAluno" randomizados. </returns> public static Aluno[] RandomizarAlunos() { int count=0; int verificador; Random rdm = new Random(); Aluno[] AlunosNaoRepetidos = new Aluno[RelacaoAluno.Count]; while (count < RelacaoAluno.Count) { verificador = rdm.Next(RelacaoAluno.Count); if (AlunosNaoRepetidos.Contains(RelacaoAluno[verificador]) == false) { AlunosNaoRepetidos[count] = RelacaoAluno[verificador]; count++; } } return (AlunosNaoRepetidos); }
public bool novo(Termo ter) { sql = "INSERT INTO termo(ter_quemcadastrou) " +"VALUES (@1)"; sql = sql.Replace("@1", ter.TerQuemCadastrou); bco.conecta(); result = bco.executeNonQuery(sql); bco.desconecta(); if (result) { Aluno alu = new Aluno(); alu.Id = Convert.ToInt32(ter.AluId); alu.TerId = ter.getUltimoId(); result = alu.addTermo(); } return result; }
public void Excluir(Aluno aluno) { try { Aluno alunoAux = new Aluno(); alunoAux.ID = aluno.ID; List<Aluno> resultado = this.Consultar(alunoAux, TipoPesquisa.E); if (resultado == null || resultado.Count == 0) throw new AlunoNaoExcluidoExcecao(); alunoAux = resultado[0]; db.Aluno.DeleteOnSubmit(alunoAux); } catch (Exception) { throw new AlunoNaoExcluidoExcecao(); } }
/// <summary> /// Realiza a adição de um objeto "Aluno" à lista "List<Aluno>" /// </summary> /// <param name="aluno">Recebe o objeto do tipo "Aluno"</param> public static void AdicionarAluno(Aluno aluno) { RelacaoAluno.Add(aluno); }
public void TestInitialize() { avaliador = new AvaliadorProva(); maria = new Aluno(1, "Maria"); jose = new Aluno(2, "José"); joao = new Aluno(3, "João"); luis = new Aluno(4, "Luis"); pedro = new Aluno(5, "Pedro"); rafael = new Aluno(6, "Rafael"); }
private void telaAlunoMatricula_Activated(object sender, EventArgs e) { uMenuLateral1.verificaTela(telaalunomatricula); uMenuImagem1.ocultarBotaoAdicionarImagem(); if (memoria.Aluno != null) { uMenuImagem1.carregaAluno(memoria.Aluno); alunoMatriculaAux = memoria.Aluno; geraNumeroMatricula(memoria.Aluno.ID); } else { limparTela(); } uMenuImagem1.ocultarBotaoAdicionarImagem(); descontoControlador = DescontoProcesso.Instance; carregaComboSerie(); cmbSerie.DataSource = listaSalaAuxiliar; Desconto d = new Desconto(); d.Status = (int)Status.Ativo; listaDescontoAux = new List<Desconto>(); listaDescontoAux = descontoControlador.Consultar(d, TipoPesquisa.E); cmbDesconto.DataSource = listaDescontoAux; cmbDesconto.DisplayMember = "Descricao"; carregarValorTotal(); }
private void btnAdd_Click(object sender, EventArgs e) { if (!editMode) { TwitterService service = new TwitterService("9fHcTGpQkdy25gAQ8bFmiOd67", "KBWAa7reZWDEofMkgDluIfLVk9dEaAZAOTinUFInw5k6xNGCX6"); // Step 1 - Retrieve an OAuth Request Token OAuthRequestToken requestToken = service.GetRequestToken(); // Step 2 - Redirect to the OAuth Authorization URL Uri uri = service.GetAuthorizationUri(requestToken); Process.Start(uri.ToString()); // Step 3 - Exchange the Request Token for an Access Token string verifier = "0350060"; // <-- This is input into your application by your user OAuthAccessToken access = service.GetAccessToken(requestToken, verifier); // Step 4 - User authenticates using the Access Token service.AuthenticateWith(access.Token, access.TokenSecret); var aluno = new Aluno((Turma)Enum.Parse(typeof(Turma), cbxTurma.Text), txtNome.Text, txtSobrenome.Text, int.Parse(txtIdade.Text), double.Parse(txtNota.Text), (Status)Enum.Parse(typeof(Status), cbxStatus.Text)); _alunoAplicacao.Adicionar(aluno); service.BeginSendTweet(new SendTweetOptions()); } else { var aluno = _alunoAplicacao.Buscar(_aluno.Id); aluno.Turma = (Turma)Enum.Parse(typeof(Turma), cbxTurma.Text); aluno.Nome = txtNome.Text; aluno.Sobrenome = txtSobrenome.Text; aluno.Idade = int.Parse(txtIdade.Text); aluno.Nota = double.Parse(txtNota.Text); aluno.Status = (Status)Enum.Parse(typeof(Status), cbxStatus.Text); _alunoAplicacao.Atualizar(aluno); } Close(); }
public void Incluir(Aluno aluno) { try { db.Aluno.InsertOnSubmit(aluno); } catch (Exception) { throw new AlunoNaoIncluidoExcecao(); } }
private void Aluno_Detach(Aluno entity) { entity.Perfil = null; }
public List<Aluno> Consultar(Aluno aluno, TipoPesquisa tipoPesquisa) { List<Aluno> resultado = Consultar(); switch (tipoPesquisa) { #region Case E case TipoPesquisa.E: { if (aluno.ID != 0) { resultado = ((from a in resultado where a.ID == aluno.ID select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Nascimento.HasValue && aluno.Nascimento.Value != default(DateTime)) { resultado = ((from a in resultado where a.Nascimento.HasValue && a.Nascimento.Value == aluno.Nascimento.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Alergico)) { resultado = ((from a in resultado where a.Alergico.Contains(aluno.Alergico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Bairro)) { resultado = ((from a in resultado where a.Bairro.Contains(aluno.Bairro) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Cep)) { resultado = ((from a in resultado where a.Cep.Contains(aluno.Cep) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Cidade)) { resultado = ((from a in resultado where a.Cidade.Contains(aluno.Cidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.ComplementoEndereco)) { resultado = ((from a in resultado where a.ComplementoEndereco.Contains(aluno.ComplementoEndereco) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.DescricaoMedica)) { resultado = ((from a in resultado where a.DescricaoMedica.Contains(aluno.DescricaoMedica) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Email)) { resultado = ((from a in resultado where a.Email.Contains(aluno.Email) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.FatorRh.HasValue) { resultado = ((from a in resultado where a.FatorRh.HasValue && a.FatorRh.Value == aluno.FatorRh.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneAluno)) { resultado = ((from a in resultado where a.FoneAluno.Contains(aluno.FoneAluno) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneEmergencia)) { resultado = ((from a in resultado where a.FoneEmergencia.Contains(aluno.FoneEmergencia) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneMedico)) { resultado = ((from a in resultado where a.FoneMedico.Contains(aluno.FoneMedico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneResidencia)) { resultado = ((from a in resultado where a.FoneResidencia.Contains(aluno.FoneResidencia) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.GrupoSanguineo)) { resultado = ((from a in resultado where a.GrupoSanguineo.Contains(aluno.GrupoSanguineo) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Hospital)) { resultado = ((from a in resultado where a.Hospital.Contains(aluno.Hospital) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Login)) { resultado = ((from a in resultado where a.Login.Contains(aluno.Login) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Logradouro)) { resultado = ((from a in resultado where a.Logradouro.Contains(aluno.Logradouro) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Nacionalidade)) { resultado = ((from a in resultado where a.Nacionalidade.Contains(aluno.Nacionalidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Nascimento.HasValue && aluno.Nascimento.Value != default(DateTime)) { resultado = ((from a in resultado where a.Nascimento.HasValue && a.Nascimento.Value == aluno.Nascimento select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Naturalidade)) { resultado = ((from a in resultado where a.Naturalidade.Contains(aluno.Naturalidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Nome)) { resultado = ((from a in resultado where a.Nome.ToUpper().Contains(aluno.Nome.ToUpper()) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.NomeMedico)) { resultado = ((from a in resultado where a.NomeMedico.Contains(aluno.NomeMedico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.PerfilID != 0 && aluno.PerfilID != null) { resultado = ((from a in resultado where a.PerfilID == aluno.PerfilID select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.PlanoSaude)) { resultado = ((from a in resultado where a.PlanoSaude.Contains(aluno.PlanoSaude) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Senha)) { resultado = ((from a in resultado where a.Senha.Contains(aluno.Senha) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Sexo.HasValue) { resultado = ((from a in resultado where a.Sexo.HasValue && a.Sexo.Value == aluno.Sexo.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.SituacaoEspecial)) { resultado = ((from a in resultado where a.SituacaoEspecial.Contains(aluno.SituacaoEspecial) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Uf)) { resultado = ((from a in resultado where a.Uf.Contains(aluno.Uf) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Contato)) { resultado = ((from a in resultado where a.Contato.Contains(aluno.Contato) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Status.HasValue) { resultado = ((from a in resultado where a.Status.HasValue && a.Status.Value == aluno.Status.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } break; } #endregion #region Case Ou case TipoPesquisa.Ou: { if (aluno.ID != 0) { resultado.AddRange((from a in Consultar() where a.ID == aluno.ID select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Nascimento.HasValue && aluno.Nascimento.Value != default(DateTime)) { resultado.AddRange((from a in Consultar() where a.Nascimento.HasValue && a.Nascimento.Value == aluno.Nascimento.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Alergico)) { resultado.AddRange((from a in Consultar() where a.Alergico.Contains(aluno.Alergico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Bairro)) { resultado.AddRange((from a in Consultar() where a.Bairro.Contains(aluno.Bairro) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Cep)) { resultado.AddRange((from a in Consultar() where a.Cep.Contains(aluno.Cep) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Cidade)) { resultado.AddRange((from a in Consultar() where a.Cidade.Contains(aluno.Cidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.ComplementoEndereco)) { resultado.AddRange((from a in Consultar() where a.ComplementoEndereco.Contains(aluno.ComplementoEndereco) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.DescricaoMedica)) { resultado.AddRange((from a in Consultar() where a.DescricaoMedica.Contains(aluno.DescricaoMedica) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Email)) { resultado.AddRange((from a in Consultar() where a.Email.Contains(aluno.Email) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.FatorRh.HasValue) { resultado.AddRange((from a in Consultar() where a.FatorRh.HasValue && a.FatorRh.Value == aluno.FatorRh.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneAluno)) { resultado.AddRange((from a in Consultar() where a.FoneAluno.Contains(aluno.FoneAluno) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneEmergencia)) { resultado.AddRange((from a in Consultar() where a.FoneEmergencia.Contains(aluno.FoneEmergencia) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneMedico)) { resultado.AddRange((from a in Consultar() where a.FoneMedico.Contains(aluno.FoneMedico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.FoneResidencia)) { resultado.AddRange((from a in Consultar() where a.FoneResidencia.Contains(aluno.FoneResidencia) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.GrupoSanguineo)) { resultado.AddRange((from a in Consultar() where a.GrupoSanguineo.Contains(aluno.GrupoSanguineo) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Hospital)) { resultado.AddRange((from a in Consultar() where a.Hospital.Contains(aluno.Hospital) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Login)) { resultado.AddRange((from a in Consultar() where a.Login.Contains(aluno.Login) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Logradouro)) { resultado.AddRange((from a in Consultar() where a.Logradouro.Contains(aluno.Logradouro) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Nacionalidade)) { resultado.AddRange((from a in Consultar() where a.Nacionalidade.Contains(aluno.Nacionalidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Nascimento.HasValue && aluno.Nascimento.Value != default(DateTime)) { resultado.AddRange((from a in Consultar() where a.Nascimento.HasValue && a.Nascimento.Value == aluno.Nascimento select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Naturalidade)) { resultado.AddRange((from a in Consultar() where a.Naturalidade.Contains(aluno.Naturalidade) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Nome)) { resultado.AddRange((from a in Consultar() where a.Nome.ToUpper().Contains(aluno.Nome.ToUpper()) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.NomeMedico)) { resultado.AddRange((from a in Consultar() where a.NomeMedico.Contains(aluno.NomeMedico) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.PerfilID != 0 && aluno.PerfilID != null) { resultado.AddRange((from a in Consultar() where a.PerfilID == aluno.PerfilID select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.PlanoSaude)) { resultado.AddRange((from a in Consultar() where a.PlanoSaude.Contains(aluno.PlanoSaude) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Senha)) { resultado.AddRange((from a in Consultar() where a.Senha.Contains(aluno.Senha) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Sexo.HasValue) { resultado.AddRange((from a in Consultar() where a.Sexo.HasValue && a.Sexo.Value == aluno.Sexo.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.SituacaoEspecial)) { resultado.AddRange((from a in Consultar() where a.SituacaoEspecial.Contains(aluno.SituacaoEspecial) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Uf)) { resultado.AddRange((from a in Consultar() where a.Uf.Contains(aluno.Uf) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(aluno.Contato)) { resultado.AddRange((from a in Consultar() where a.Contato.Contains(aluno.Contato) select a).ToList()); resultado = resultado.Distinct().ToList(); } if (aluno.Status.HasValue) { resultado.AddRange((from a in Consultar() where a.Status.HasValue && a.Status.Value == aluno.Status.Value select a).ToList()); resultado = resultado.Distinct().ToList(); } break; } #endregion default: break; } return resultado; }
private void btnAluno_Click(object sender, EventArgs e) { frmAluGerenciamento frmAlu = new frmAluGerenciamento(true, user); frmAlu.ShowDialog(); if (frmAlu.getPesquisaRealizada()) { mod.Id = ""; ttbModalidade.Text = "Todas"; rbAtivasInativas.Checked = true; rbDiaristaMensalista.Checked = true; alu.Id = frmAlu.getAluId(); alu = alu.getAlunoById(); ttbAluno.Text = alu.Nome; } else { alu.Id = 0; ttbAluno.Text = "Todos"; } }
private void incluirButton_Click(object sender, EventArgs e) { long rm; if (String.IsNullOrWhiteSpace(rmTextBox.Text)) { MessageBox.Show("RM não preechido"); return; } else if (!long.TryParse(rmTextBox.Text, out rm)) { MessageBox.Show("RM deve conter somente dígitos"); return; } else if(_listaOrdenada.ContainsKey(rmTextBox.Text)) { MessageBox.Show("RM duplicado"); return; } if (String.IsNullOrWhiteSpace(nomeTextBox.Text)) { MessageBox.Show("Nome não preechido"); return; } _aluno.Nome = nomeTextBox.Text; _aluno.RM = rmTextBox.Text; _pilha.Push(_aluno); _fila.Enqueue(_aluno); _listaOrdenada.Add(_aluno.RM, _aluno); _aluno = new Aluno(); rmTextBox.Text = String.Empty; nomeTextBox.Text = String.Empty; nota1TextBox.Text = String.Empty; nota2TextBox.Text = String.Empty; nota3TextBox.Text = String.Empty; nota1Label.Text = "0,0"; nota2Label.Text = "0,0"; nota3Label.Text = "0,0"; }
private void Aluno_Attach(Aluno entity) { entity.Perfil = this; }