public void Alterar(Matricula matricula) { try { Matricula matriculaAux = new Matricula(); matriculaAux.ID = matricula.ID; List<Matricula> resultado = this.Consultar(matriculaAux, TipoPesquisa.E); if (resultado == null || resultado.Count == 0) throw new MatriculaNaoAlteradaExcecao(); matriculaAux = resultado[0]; matriculaAux.NumMatricula = matricula.NumMatricula; matriculaAux.SalaPeriodoID = matricula.SalaPeriodoID; matriculaAux.Status = matricula.Status; matriculaAux.Valor = matricula.Valor; matriculaAux.AlunoID = matricula.AlunoID; matriculaAux.BoletoMensalidade = matricula.BoletoMensalidade; matriculaAux.DataMatricula = matricula.DataMatricula; matriculaAux.DescontoID = matricula.DescontoID; matriculaAux.DiaVencimento = matricula.DiaVencimento; matriculaAux.Ano = matricula.Ano; Confirmar(); } catch (Exception) { throw new MatriculaNaoAlteradaExcecao(); } }
public void Iniciar() { //Las Personas this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 11; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 12; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 13; this.persona4 = FabricaEntidades.ObtenerPersona(); this.persona4.Id = 14; //Implemento this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Eventos this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento(); this.evento.Id = 1; this.evento.Costo = 0; //Matricula this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula(); this.matricula.Id = 37; this.matricula.Costo = 4250; //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoVerCarrito(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoVerCarrito(this.persona); this.pruebaComandoVacio3 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito(); this.pruebaComandoVacio4 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito(this.persona); //Carrito Cuando hay solo Implementos this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 5); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloImplemento = FabricaComandos.CrearComandoVerCarrito(this.persona); //Carrito Cuando hay solo Eventos this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.evento, 2, 6); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloEvento = FabricaComandos.CrearComandoVerCarrito(this.persona2); //Carrito Cuando hay solo Matriculas this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 1); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloMatricula = FabricaComandos.CrearComandoVerCarrito(this.persona3); //Carrito Cuando hay Implementos, Eventos y Matriculas this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.implemento, 1, 5); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem (this.persona4, this.evento, 2, 6); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.matricula, 3, 1); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerTodo = FabricaComandos.CrearComandoVerCarrito(this.persona4); }
/// <summary> /// Constructor vacio de la clase DetalleFacturaMatricula /// </summary> public DetalleFacturaMatricula() { this.matricula = new Matricula(); this.matricula.Identificador = ""; this.matricula.Costo = 0; this.cantidad_matricula = 0; this.Subtotal = 0; }
public void Iniciar() { //Las personas this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 11; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 12; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 13; //Implemento this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Matricula this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //Evento this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoModificarCarrito(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoModificarCarrito (this.persona, this.implemento,1, 30); this.pruebaComandoVacio3 = (ComandoModificarCarrito)FabricaComandos.CrearComandoModificarCarrito(); this.pruebaComandoVacio4 = (ComandoModificarCarrito)FabricaComandos.CrearComandoModificarCarrito (this.persona, this.implemento, 1, 30); //Items que agregaremos para despues modificar this.PruebaSoloImplementos = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 20); this.PruebaSoloImplementos.Ejecutar(); this.PruebaSoloEventos = FabricaComandos.CrearComandoAgregarItem(this.persona2, this.listaEventos[0], 2, 10); this.PruebaSoloEventos.Ejecutar(); this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.implemento, 1, 20); this.PruebaTodosItems.Ejecutar(); this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.listaEventos[0], 2, 10); this.PruebaTodosItems.Ejecutar(); this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 1); this.PruebaTodosItems.Ejecutar(); //ModificarCarrito del primer test this.ComandoModificarCarrito = FabricaComandos.CrearComandoModificarCarrito(this.persona, this.implemento, 1, 7); this.ComandoModificarCarrito2 = FabricaComandos.CrearComandoModificarCarrito(this.persona2, this.listaEventos[0], 2, 7); this.ComandoModificarCarrito3 = FabricaComandos.CrearComandoModificarCarrito(this.persona3, this.implemento, 1, 7); this.ComandoModificarCarrito6 = FabricaComandos.CrearComandoModificarCarrito(this.persona3, this.listaEventos[0], 2, 7); //ModificarCarrito del segundo test this.ComandoModificarCarrito4 = FabricaComandos.CrearComandoModificarCarrito(this.persona, this.implemento, 1, 8000); this.ComandoModificarCarrito5 = FabricaComandos.CrearComandoModificarCarrito(this.persona3, this.implemento, 1, 8000); }
public void Iniciar() { //Las Personas this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 20; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 21; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 22; this.persona4 = FabricaEntidades.ObtenerPersona(); this.persona4.Id = 23; //Implemento this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Eventos this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Matricula this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoVerCarrito(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoVerCarrito(this.persona); this.pruebaComandoVacio3 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito(); this.pruebaComandoVacio4 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito(this.persona); //Carrito Cuando hay solo Implementos this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 5); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloImplemento = FabricaComandos.CrearComandoVerCarrito(this.persona); //Carrito Cuando hay solo Eventos this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona2, this.listaEventos[0], 2, 6); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloEvento = FabricaComandos.CrearComandoVerCarrito(this.persona2); //Carrito Cuando hay solo Matriculas this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 1); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerSoloMatricula = FabricaComandos.CrearComandoVerCarrito(this.persona3); //Carrito Cuando hay Implementos, Eventos y Matriculas this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.implemento, 1, 5); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.listaEventos[0], 2, 6); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.matricula, 3, 1); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerTodo = FabricaComandos.CrearComandoVerCarrito(this.persona4); }
public ActionResult Create([Bind(Include = "Id,AlunoId,TurmaId,DataDeMatricula")] Matricula matricula) { if (ModelState.IsValid) { db.Matriculas.Add(matricula); db.SaveChanges(); TempData["Mensagem"] = "Matricula cadastrada com sucesso! "; return(RedirectToAction("Index")); } ViewBag.AlunoId = new SelectList(db.Alunos, "AlunoId", "Nome", matricula.AlunoId); ViewBag.TurmaId = new SelectList(db.Turmas, "Id", "Descricao", matricula.TurmaId); return(View(matricula)); }
public Matricula EditarMatricula(Matricula matricula) { Matricula a = ctx.Matricula.Find(matricula.IdMatricula); a.AlunoIDMatricula = matricula.AlunoIDMatricula; a.AlunoMatricula = matricula.AlunoMatricula; a.CursoIDMatricula = matricula.CursoIDMatricula; a.CursoMatricula = matricula.CursoMatricula; a.InstituicaoMatricula = matricula.InstituicaoMatricula; a.InstituicaoIDMatricula = matricula.InstituicaoIDMatricula; ctx.Entry(a).State = EntityState.Modified; ctx.SaveChanges(); return(matricula); }
private void btnAgregar_Click(object sender, EventArgs e) { if (cmbGrupos.SelectedIndex > -1) { if (lblIdDetalle.Text != "") { if (lblIAlumno.Text != "") { try { Matricula matricula = new Matricula(); if (matricula.Matricular(int.Parse(lblIdDetalle.Text), int.Parse(lblIAlumno.Text)) == true) { if (matricula.actualizarEstadoMatricula(int.Parse(lblIAlumno.Text)) == true) { MessageBox.Show("Alumno matriculado con éxito"); lblApellidoA.Text = ""; lblNombreA.Text = ""; ActualizarDataGrid(); mostrarMatriculas(); } else { MessageBox.Show("ERROR AL MATRICULAR"); } } else { MessageBox.Show("ERROR AL MATRICULAR"); } }catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Seleccione un alumno"); } } else { MessageBox.Show("Seleccione un grupo"); } } else { MessageBox.Show("Seleccione un grupo"); } }
public void DeveCriarMatricula() { var curso = CursoBuilder.Novo().ComPublicoAlvo(PublicoAlvo.Empreendedor).Build(); var matriculaEsperada = new { Aluno = AlunoBuilder.Novo().ComPublicoAlvo(PublicoAlvo.Empreendedor).Build(), Curso = curso, ValorPago = curso.Valor }; var matricula = new Matricula(matriculaEsperada.Aluno, matriculaEsperada.Curso, matriculaEsperada.ValorPago); matriculaEsperada.ToExpectedObject().ShouldMatch(matricula); }
public ActionResult Create([Bind(Include = "MatriculaId,UserId,GrupoClaseId,CursoId")] Matricula matricula) { if (ModelState.IsValid) { db.Matriculas.Add(matricula); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CursoId = new SelectList(db.Cursoes, "CursoId", "Ano", matricula.CursoId); ViewBag.GrupoClaseId = new SelectList(db.GrupoClases, "GrupoClaseID", "Nombre", matricula.GrupoClaseId); ViewBag.UserId = new SelectList(db.Users, "Id", "Email", matricula.UserId); return(View(matricula)); }
// GET: Matriculas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = db.Matriculas.Find(id); if (matricula == null) { return(HttpNotFound()); } return(View(matricula)); }
public async Task <IHttpActionResult> DeleteMatricula(int id) { Matricula matricula = await db.Matriculas.FindAsync(id); if (matricula == null) { return(NotFound()); } db.Matriculas.Remove(matricula); await db.SaveChangesAsync(); return(Ok(matricula)); }
public ActionResult Listado() { if (Session["UserName"] != null) { Matricula objMatricula = new Matricula(); DataAccessMatricula objDB = new DataAccessMatricula(); objMatricula.ShowallMatricula = objDB.GetAllMatricula(); return(View(objMatricula)); } else { return(RedirectToAction("Index", "Login")); } }
public async Task <IActionResult> Create([Bind("Idmatricula,Idalumno,Idprofesor,Idmateria,Nota")] Matricula matricula) { if (ModelState.IsValid) { _context.Add(matricula); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Idalumno"] = new SelectList(_context.Alumno, "Idalumno", "Idalumno", matricula.Idalumno); ViewData["Idmateria"] = new SelectList(_context.Materia, "Idmateria", "Idmateria", matricula.Idmateria); ViewData["Idprofesor"] = new SelectList(_context.Profesor, "Idprofesor", "Idprofesor", matricula.Idprofesor); return(View(matricula)); }
// GET: Matriculas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = matriculaService.BuscarMatriculaPorId(id); if (matricula == null) { return(HttpNotFound()); } return(View(matricula)); }
public JsonResult BuscaCep(string cep) { var cepDados = ViaCEP.ViaCEPClient.Search(cep); Matricula model = new Matricula { Bairro = cepDados.Neighborhood, CEP = cep, Cidade = cepDados.City, Endereco = cepDados.Street, Estado = cepDados.StateInitials }; return(Json(model)); }
public JsonResult Details(MatriculaModelView model) { Matricula entidad = _iMatriculaService.Get(model.Id); var institucionVista = new { entidad.Id, EstudianteNombre = entidad.Estudiante.ToString(), ComponenteEducativoCodigo = entidad.ComponenteEducativo.Codigo, ComponenteEducativoNombre = entidad.ComponenteEducativo.Nombre, entidad.Fecha }; return(Json(institucionVista, JsonRequestBehavior.AllowGet)); }
// GET: Matriculas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = MatriculaBLL.Get(id); if (matricula == null) { return(HttpNotFound()); } return(View(matricula)); }
public IHttpActionResult DeleteMatricula(int id) { Matricula matricula = db.Matriculas.Find(id); if (matricula == null) { return(NotFound()); } db.Matriculas.Remove(matricula); db.SaveChanges(); return(Ok(matricula)); }
public void Salvar(int alunoId, int cursoId) { var curso = _cursoRepositorio.ObterPor(alunoId); var aluno = _alunoRepositorio.ObterPor(alunoId); var matricula = new Matricula(); matricula.Aluno = aluno; matricula.Curso = curso; Validar(curso, aluno, matricula); _matriculaRepositorio.Salvar(matricula); }
public MainWindow(Matricula matricula) { InitializeComponent(); //se llama la variable con el Id de la tabla clientes id = matricula.Id; txtmatriculas.Text = matricula.Nie + "" + matricula.Primer_Apellido + "" + matricula.Segundo_Apellido + "" + matricula.Primer_Nombre + "" + matricula.Segundo_Nombre + "" + matricula.Tercer_Nombre; //se llama la variable con el Id de la tabla clientes id = matricula.Id; textBlock.Text = matricula.Nie + "" + matricula.Primer_Apellido + "" + matricula.Segundo_Apellido + "" + matricula.Primer_Apellido + "" + matricula.Tercer_Nombre + "" + matricula.Segundo_Nombre + "" + matricula.Tercer_Nombre; }
public ActionResult Create([Bind(Include = "id,CursoId,GrupoId,UsuarioId,codigo")] Matricula matricula) { if (ModelState.IsValid) { db.Matriculas.Add(matricula); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CursoId = new SelectList(db.Cursos, "Id", "nombre", matricula.CursoId); ViewBag.GrupoId = new SelectList(db.GrupoClases, "Id", "nombre", matricula.GrupoId); ViewBag.UsuarioId = new SelectList(db.Users, "Id", "Name", matricula.UsuarioId); return(View(matricula)); }
public static List <Matricula> searchMatriculasNoParametro(string Text, Int64 pIdSucursal, int pLimit) { List <Matricula> lista = new List <Matricula>(); using (MySqlConnection _con = new Conexion().Conectar()) { try { _con.Open(); MySqlCommand comando = new MySqlCommand("select m.* from matricula as m inner join curso as c on c.Id =m.IdCurso " + "inner join year as y on y.Id=c.IdYear inner join estudiante as e on e.Id=m.IdEstudiante inner join persona as p " + "on p.Id=e.IdPersona where( Upper(p.Nombre) like '%" + Text.ToUpper() + "%' or Upper(e.Telefono) like '%" + Text.ToUpper() + "%' or Upper(e.TelEmergencia) like '%" + Text.ToUpper() + "%' or Upper(e.ParentEmergencia) like '%" + Text.ToUpper() + "%') and (c.IdSucursal=@pIdSucursal) and m.Estado='A' order by Id asc limit @pLimit", _con); comando.Parameters.AddWithValue("@pLimit", pLimit + 900); comando.Parameters.AddWithValue("@pIdSucursal", pIdSucursal); MySqlDataReader _reader = comando.ExecuteReader(); while (_reader.Read()) { Matricula item = new Matricula( _reader.GetInt64(0), _reader.GetString(1), _reader.GetString(2), _reader.GetInt32(3), _reader.GetString(4), _reader.GetInt64(5), _reader.GetInt64(6), EstudianteDAL.getEstudianteById(_reader.GetInt64(6)), CuotaDAL.getCuotasByIdMatricula(_reader.GetInt64(0), 50), DetMatriculaDAL.getDetsmatriculaByIdMatricula(_reader.GetInt64(0), 2) ); lista.Add(item); } _reader.Close(); } catch (Exception ex) { _con.Close(); throw ex; } finally { _con.Close(); } } return(lista); }
private void ucMenuInferior1_EventoCadastrar() { try { if (cmbAluno.SelectedItem == null) { errorProviderTela.SetError(cmbAluno, "Nenhum Aluno selecionado"); return; } Matricula matricula = CarregarMatricula((Aluno)cmbAluno.SelectedItem); var resultado = (from m in matriculaVinculoListaAlunoAtualMestre where m.MatriculaDependenteID == matricula.ID select m).ToList(); if (resultado.Count > 0) { errorProviderTela.SetError(cmbAluno, "Aluno já vinculado."); return; } IMatriculaVinculoProcesso processo = MatriculaVinculoProcesso.Instance; MatriculaVinculo mv = new MatriculaVinculo(); mv.MatriculaDependenteID = matricula.ID; mv.MatriculaMestreID = Memoria.Instance.Matricula.ID; mv.DataVinculo = DateTime.Now; mv.Status = (int)Status.Ativo; switch (Memoria.Instance.StatusTelaAlunoMatriculaVinculo) { case OperacoesDaTela.Incluir: { processo.Incluir(mv); processo.Confirmar(); break; } case OperacoesDaTela.Alterar: { processo.Alterar(mv); processo.Confirmar(); break; } } Memoria.Instance.StatusTelaAlunoMatriculaVinculo = OperacoesDaTela.Navegar; Atualizar(); AjustarBotoes(); } catch (Exception) { } }
private Matricula GerarMatriculaAluno() { Matricula matricula = new Matricula(); matricula.Status = 1; matricula.AlunoID = memoria.Aluno.ID; IMatriculaProcesso matriculaControlador = MatriculaProcesso.Instance; List <Matricula> matriculaAuxiliarList = new List <Matricula>(); matricula = matriculaControlador.Consultar(matricula, Negocios.ModuloBasico.Enums.TipoPesquisa.E)[0]; return(matricula); }
/// <summary> /// MatriculaViewModel /// </summary> /// <param name="matricula">Matricula</param> public MatriculaViewModel(Matricula matricula) { Id = matricula.Id; NomeAluno = matricula.Aluno.Nome; IdAluno = matricula.Aluno.Id; // DtCadastro = matricula.DtCadastro; DtExclusao = matricula.DtExclusao; QtdAula = matricula.QtdAula; IdEstado = matricula.Estado.Id; HoraAula = matricula.HoraAula; CodigoCfc = matricula.CodigoCfc; PSA = matricula.Psa; Cpf = _repoAluno.Listar().Where(m => m.Id == matricula.Aluno.Id).FirstOrDefault().CpfAluno; ListaEstado = CarregarEstado(matricula.Id).AsEnumerable(); }
private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is Matricula); if (frm != null) { //si la instancia existe la pongo en primer plano frm.BringToFront(); return; } var FrmBod = new Matricula(); FrmBod.MdiParent = this; FrmBod.Show(); }
private void Validar(Curso curso, Aluno aluno, Matricula matricula) { if (aluno == null) { throw new Exception("Aluno não encontrado"); } if (curso == null) { throw new Exception("Curso não encontrado"); } if (curso.PublicoAlvo != aluno.PublicoAlvo) { throw new Exception("Publico alvo de aluno não pode ser diferente do curso"); } }
// GET: Matriculas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = db.Matriculas.Find(id); if (matricula == null) { return(HttpNotFound()); } ViewBag.AlumnoID = new SelectList(db.Alumnoes, "AluID", "Apellidos", matricula.AlumnoID); return(View(matricula)); }
public ModificarMatricula(int idM) { InitializeComponent(); co = new ConnectOracle(); m = co.BuscarMatricula(idM); a = co.buscarAlumno(m.idAlumno); co.getAlumnos(); ConnectOracle.AlumList.ForEach(x => this.cbAlum.Items.Add(x.DNI)); cbAlum.SelectedItem = a.DNI; al = co.buscarAlumno(cbAlum.SelectedItem.ToString()); co.getGrupos(al.Id); cbGrup.Items.Clear(); ConnectOracle.GrupList.ForEach(x => this.cbGrup.Items.Add(x.nombre)); }
public Matricula RealizarMatricula(Guid usuarioId, Guid cursoid) { var usuario = usuarioRepository.Obtem(usuarioId); var curso = repository.Obtem(cursoid); if (usuario != null && curso != null) { var matricula = new Matricula(curso, usuario, DateTime.Now); matricula.GerarPagamento(); matriculaRepository.Adiciona(matricula); emailRepository.Enviar(usuario.Email, "CursosOn", $"Ola {usuario.Nome} \n Sua matrícula foi realizada com sucesso"); return(matricula); } return(null); }
public async Task <bool> CreateMatriculaAsync(MatriculaRequest matriculaRequest) { var aluno = _alunoService.GetAlunoByRa(matriculaRequest.Ra); if (MatriculaExist(aluno, matriculaRequest.CodGrade)) { return(false); } var codigoSubgrade = await _subgradeService.GetCodigoSubgradeToCreateMatriculaAsync(matriculaRequest.CodGrade); var matricula = new Matricula(aluno.Cpf, codigoSubgrade); return(await _matriculaRepository.CreateAsync(matricula)); }
public ActionResult Edit([Bind(Include = "idmatricula,fecha,costo,estado,tipo,idalumno,idmateria")] Matricula matricula) { if (ModelState.IsValid) { matricula = MatriculaBLL.TransforEnumCreate(matricula); MatriculaBLL.Update(matricula); return(RedirectToAction("Index")); } MatriculaBLL.TransforEnum(matricula); ViewBag.tipo = new SelectList(MatriculaBLL.ListEnum("tipo"), matricula.tipo); ViewBag.estado = new SelectList(MatriculaBLL.ListEnum("estado"), matricula.estado); ViewBag.idalumno = new SelectList(AlumnoBLL.List(), "idalumno", "nombres", matricula.idalumno); ViewBag.idmateria = new SelectList(MateriaBLL.List(), "idmateria", "nombre", matricula.idmateria); return(View(matricula)); }
// GET: Matriculas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = db.Matriculas.Find(id); if (matricula == null) { return(HttpNotFound()); } ViewBag.GrupoId = new SelectList(db.GrupoClases, "Id", "Id", matricula.GrupoId); return(View(matricula)); }
// GET: Matricula/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Matricula matricula = db.Matriculas.Find(id); if (matricula == null) { return(HttpNotFound()); } ViewBag.CarreraId = new SelectList(db.Carreras, "CarreraId", "Descripcion", matricula.CarreraId); return(View(matricula)); }
public void Iniciar() { //Obtengo el DAO this.daoPrueba = FabricaDAOSqlServer.ObtenerdaoCarrito(); //La persona this.persona = new Persona(); this.persona.Id = 11; this.persona2 = new Persona(); this.persona2.Id = 12; this.persona3 = new Persona(); this.persona3.Id = 13; this.persona4 = new Persona(); this.persona4.Id = 14; this.persona5 = new Persona(); this.persona5.Id = 15; this.persona6 = new Persona(); this.persona6.Id = 16; //Dos implementos distintos this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; this.implemento2 = new Implemento(); this.implemento2.Id = 2; this.implemento2.Precio_Implemento = 3000; //Eventos this.listaEventos = FabricaComandos.CrearComandoConsultarTodosEventos().Ejecutar(); //Dos matriculas distintas this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; this.matricula2 = new Matricula(); this.matricula2.Id = 2; this.matricula2.Costo = 4500; }
public void Incluir(Matricula matricula) { try { db.Matricula.InsertOnSubmit(matricula); } catch (Exception) { throw new MatriculaNaoIncluidaExcecao(); } }
public Atleta(Matricula matricula) : base() { this._matricula = matricula; }
public void Iniciar() { //La persona this.persona = new Persona(); this.persona.Id = 11; this.persona2 = new Persona(); this.persona2.Id = 12; this.persona3 = new Persona(); this.persona3.Id = 13; //Dos implementos distintos this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; this.implemento2 = new Implemento(); this.implemento2.Id = 2; this.implemento2.Precio_Implemento = 3000; //Eventos this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Dos matriculas distintas this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; this.matricula2 = new Matricula(); this.matricula2.Id = 2; this.matricula2.Costo = 4500; //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoAgregarItem(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 10); this.pruebaComandoVacio3 = (ComandoAgregarItem)FabricaComandos.CrearComandoAgregarItem(); this.pruebaComandoVacio4 = (ComandoAgregarItem)FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 10); //Diferentes valores para Agregar un Implemento this.pruebaComandoImplemento1 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 10); this.pruebaComandoImplemento2 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 11); this.pruebaComandoImplemento3 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento2, 1, 30); this.pruebaComandoImplemento4 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.listaEventos[0], 2, 20); //Diferentes valores para Agregar un Evento this.pruebaComandoEvento1 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[0], 2, 10); this.pruebaComandoEvento2 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[0], 2, 11); this.pruebaComandoEvento3 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[1], 2, 30); this.pruebaComandoEvento4 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.matricula, 3, 20); //Diferentes valores para Agregar una Matricula this.pruebaComandoMatricula1 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3, 10); this.pruebaComandoMatricula2 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3 , 11); this.pruebaComandoMatricula3 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3, 30); this.pruebaComandoMatricula4 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.implemento, 1, 20); }
private void ucMenuInferior1_EventoCadastrar() { matriculaControlador = MatriculaProcesso.Instance; matricula = new Matricula(); try { #region VALIDA - SERIE if (String.IsNullOrEmpty(cmbSerie.Text)) { errorProviderTela.SetError(cmbSerie, "Informe a série"); return; } int salaPeriodoIdAux = ((SalaAuxiliar)cmbSerie.SelectedItem).IdSalaAux; matricula.SalaPeriodoID = salaPeriodoIdAux; #endregion #region VALIDA - DESCONTO if (String.IsNullOrEmpty(cmbDesconto.Text)) { errorProviderTela.SetError(cmbDesconto, "Informe o desconto"); return; } matricula.DescontoID = ((Desconto)cmbDesconto.SelectedItem).ID; #endregion #region VALIDA - VALOR if (String.IsNullOrEmpty(txtValor.Text)) { errorProviderTela.SetError(txtValor, "Informe o valor"); txtValor.Clear(); return; } #endregion #region VALIDA - VALOR TOTAL if (String.IsNullOrEmpty(txtTotalValor.Text)) { errorProviderTela.SetError(txtValor, "Informe o valor total"); txtTotalValor.Clear(); return; } matricula.Valor = Convert.ToDouble(txtTotalValor.Text); #endregion #region VALIDA - DIA VENCIMENTO if (String.IsNullOrEmpty(cmbVencimento.Text)) { errorProviderTela.SetError(cmbVencimento, "Informe o vencimento"); return; } matricula.DiaVencimento = Convert.ToInt32(cmbVencimento.Text); #endregion matricula.DataMatricula = DateTime.Now; matricula.Ano = DateTime.Now.Year; matricula.NumMatricula = lblNumeroMatricula.Text; matricula.Status = 1; matricula.AlunoID = alunoMatriculaAux.ID; if (verificaSeJaInserido(matricula) == false) { matriculaControlador.Incluir(matricula); matriculaControlador.Confirmar(); for (int i = 0; i < 12; i++) { boletoMensalidadeControlador = BoletoMensalidadeProcesso.Instance; boletoMensalidade = new BoletoMensalidade(); boletoMensalidade.Descricao = "BOLETO"; DateTime novoDtParcela = new DateTime(DateTime.Now.Year, 1, Convert.ToInt32(cmbVencimento.Text)); boletoMensalidade.DataVencimento = novoDtParcela.AddMonths(i); boletoMensalidade.Status = 1; boletoMensalidade.Desconto = ((Desconto)cmbDesconto.SelectedItem).Percentual; boletoMensalidade.Parcela = meses[novoDtParcela.AddMonths(i).Month]; boletoMensalidade.MatriculaID = matricula.ID; boletoMensalidade.DataEmissao = DateTime.Now; boletoMensalidade.Valor = matricula.Valor; boletoMensalidadeControlador.Incluir(boletoMensalidade); boletoMensalidadeControlador.Confirmar(); } IAlunoProcesso alunoControlador = AlunoProcesso.Instance; alunoMatriculaAux.SerieAtual = matricula.SalaPeriodo.Sala.Serie.Nome; alunoControlador.Alterar(alunoMatriculaAux); alunoControlador.Confirmar(); MessageBox.Show(MatriculaConstantes.MATRICULA_INCLUIDA, "Colégio Conhecer - Inserir Matrícula"); memoria.Aluno = alunoMatriculaAux; } else { MessageBox.Show("A Matrícula já existe na base de dados", "Colégio Conhecer - Inserir Matrícula"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } limparTela(); }
private void Matricula_Detach(Matricula entity) { entity.Desconto = null; }
private void Matricula_Detach(Matricula entity) { entity.Aluno = null; }
private void Matricula_Detach(Matricula entity) { entity.SalaPeriodo = null; }
/// <summary> /// Método para carregar dados do aluno /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void carregaAluno(Aluno aluno) { if (aluno != null) { #region Verifica existência de matrícula e atribui a variável Matricula matricula = new Matricula(); IMatriculaProcesso matriculaControlador = MatriculaProcesso.Instance; List<Matricula> matriculaAuxiliar = new List<Matricula>(); matricula.Status = (int)Status.Ativo; matriculaAuxiliar = matriculaControlador.Consultar(matricula, TipoPesquisa.E); foreach (Matricula m in matriculaAuxiliar) { if (m.AlunoID == aluno.ID) { numMatricula = m.NumMatricula; Memoria.Instance.Matricula = m; } } #endregion #region Exibe o status Ativo ou Inativo if (aluno.Status == (int)Status.Ativo) { lblAtivo.Text = "Ativo"; } else { lblAtivo.ForeColor = System.Drawing.Color.Black; lblAtivo.Text = "Inativo"; } #endregion #region Exibe o fone de emergência if (!String.IsNullOrEmpty(aluno.FoneEmergencia)) { lblFoneEmerg.Text = aluno.FoneEmergencia; } else { lblFoneEmerg.Text = "Telefone de emergência não cadastrado no aluno"; } #endregion #region Seta a matrícula caso exista if (numMatricula != null) { lblMatricula.Text = numMatricula; } else { lblMatricula.ForeColor = System.Drawing.Color.Black; lblMatricula.Text = "Aluno ainda não matriculado"; } #endregion lblNomeAluno.Text = aluno.Nome; #region Seta a série atual caso definida if (!String.IsNullOrEmpty(aluno.SerieAtual)) { lblSerie.Text = aluno.SerieAtual; } else { lblSerie.ForeColor = System.Drawing.Color.Black; lblSerie.Text = "Aluno ainda não matriculado em uma série"; } #endregion #region seta a imagem caso exista if (aluno.Imagem != null && aluno.Imagem.Length > 0) { pctImagem.Image = arrayParaImagem(aluno.Imagem); } else { pctImagem.Image = null; } #endregion } else { lblAtivo.Text = ""; lblFoneEmerg.Text = ""; lblMatricula.Text = ""; lblNomeAluno.Text = ""; lblSerie.Text = ""; } }
public void PruebaCarritoVariosItems() { //Agregamos todos los items en el carrito de una persona this.daoPrueba.agregarItem(this.persona4, this.implemento, 1, 5); this.daoPrueba.agregarItem(this.persona4, this.listaEventos[0], 2, 6); this.daoPrueba.agregarItem(this.persona4, this.matricula, 3, 1); //Ejecutamos los metodos correspondientes para ver los items this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona4); this.EventosCarrito = this.daoPrueba.getEvento(this.persona4); this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona4); /*Revisamos que hayan Implementos, Eventos y matriculas, ademas, que efectivamente haya solo uno agregado de cada uno de ellos*/ Assert.IsTrue(this.ImplementosCarrito.Count == 1); Assert.IsTrue(this.EventosCarrito.Count == 1); Assert.IsTrue(this.MatriculasCarrito.Count == 1); //Obtenemos los items y verificamos sus valores this.implemento = this.ImplementosCarrito.ElementAt(0).Key as Implemento; Assert.AreEqual(this.implemento.Id_Implemento, 1); Assert.AreEqual(this.implemento.Precio_Implemento, 4500); Assert.AreEqual(this.ImplementosCarrito.ElementAt(0).Value, 5); this.evento = this.EventosCarrito.ElementAt(0).Key as Evento; Assert.AreEqual(this.evento.Id_evento, 1); Assert.AreEqual(this.evento.Costo, 0); Assert.AreEqual(this.EventosCarrito.ElementAt(0).Value, 6); this.matricula = this.MatriculasCarrito.ElementAt(0).Key as Matricula; Assert.AreEqual(this.matricula.Id, 1); //Assert.AreEqual(this.matricula.Costo, 5000); //PILAS CON EL COSTO ARREGLAR Assert.AreEqual(this.MatriculasCarrito.ElementAt(0).Value, 1); }
/// <summary> /// Método para verificar a matricula e retornar para a tela /// </summary> /// <param name="memoria">Recebe um objeto tipo memoria (Memoria.Aluno)</param> /// <returns>retorna uma string com a matrícula</returns> private String retornaMatricula(Memoria memoria) { string numMatricula = null; Matricula matricula = new Matricula(); IMatriculaProcesso matriculaControlador = MatriculaProcesso.Instance; List<Matricula> matriculaAuxiliar = new List<Matricula>(); matricula.Status = (int)Status.Ativo; matriculaAuxiliar = matriculaControlador.Consultar(matricula, TipoPesquisa.E); foreach (Matricula m in matriculaAuxiliar) { if (m.AlunoID == memoria.Aluno.ID) { numMatricula = m.NumMatricula; } } return numMatricula; }
/// <summary> /// Método para retornar o número da matrícula do aluno em questão /// </summary> /// <param name="memoria"></param> /// <returns></returns> private int retornaIdMatricula(Memoria memoria) { int matriculaAux = -1; IMatriculaProcesso matriculaProcesso = MatriculaProcesso.Instance; Matricula matriculaAuxObj = new Matricula(); List<Matricula> listaAlunoAux = new List<Matricula>(); matriculaAuxObj.AlunoID = memoria.Aluno.ID; matriculaAuxObj.Ano = DateTime.Now.Year; listaAlunoAux = matriculaProcesso.Consultar(matriculaAuxObj, TipoPesquisa.E); if (listaAlunoAux.Count > 0) { matriculaAux = listaAlunoAux[0].ID; } return matriculaAux; }
public Atleta(int id,Matricula matricula) : base(id) { this._matricula = matricula; }
private void Matricula_Attach(Matricula entity) { entity.SalaPeriodo = this; }
public void Iniciar() { //Dos implementos distintos this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //La persona this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 11; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 12; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 13; this.persona4 = FabricaEntidades.ObtenerPersona(); this.persona4.Id = 14; this.persona5 = FabricaEntidades.ObtenerPersona(); this.persona5.Id = 15; this.persona6 = FabricaEntidades.ObtenerPersona(); this.persona6.Id = 16; //Iniciamos los atributos para la prueba de vacio this.datoPago = new List<String>(); this.datoPago.Add("123456789"); this.pago = FabricaEntidades.ObtenerPago(111,"Deposito", this.datoPago); this.PruebaComandoVacio = FabricaComandos.CrearComandoRegistrarPago(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoRegistrarPago(this.persona, this.pago); this.pruebaComandoVacio3 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago(); this.pruebaComandoVacio4 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago (this.persona, this.pago); //Implemento this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Eventos this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento(); this.evento.Id = 1; this.evento.Costo = 0; //Matricula this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //Insertamos la cantidad de implementos que no pueden ser satisfechos por el stock this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona5, this.implemento, 1, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); //Insertamos una cantidad de inventario que no puede ser satisfecho de igual forma para esta persona this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona6, this.implemento, 1, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem (this.persona6, this.evento, 2, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona6, this.matricula, 3, 10); this.ComandoAgregarItem.Ejecutar(); }
private void Matricula_Attach(Matricula entity) { entity.Aluno = this; }
public void Limpiar() { //Elimino de la persona5 this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona5); this.ComandoEliminar.Ejecutar(); //Elimino de la persona6 this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona6); this.ComandoEliminar.Ejecutar(); this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(3, this.evento, this.persona6); this.ComandoEliminar.Ejecutar(); this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona6); this.ComandoEliminar.Ejecutar(); //Limpio los demas valores this.ComandoEliminar = null; this.persona = null; this.persona2 = null; this.persona3 = null; this.persona4 = null; this.persona5 = null; this.persona6 = null; this.matricula = null; this.implemento = null; this.evento = null; this.PruebaComandoVacio = null; this.PruebaComandoVacio2 = null; this.pruebaComandoVacio3 = null; this.pruebaComandoVacio4 = null; this.ComandoAgregarItem = null; this.ComandoRegistrarPago = null; this.pago = null; this.datoPago = null; }
private void Matricula_Attach(Matricula entity) { entity.Desconto = this; }
public void Iniciar() { //La persona this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 11; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 12; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 13; this.persona4 = FabricaEntidades.ObtenerPersona(); this.persona4.Id = 14; //Dos implementos distintos this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; this.implemento2 = (Implemento)FabricaEntidades.ObtenerImplemento(); this.implemento2.Id = 5; this.implemento2.Precio_Implemento = 3000; //Eventos this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento(); this.evento.Id = 1; this.evento.Costo = 0; this.evento2 = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento(); this.evento2.Id = 2; this.evento2.Costo = 2000; //Dos matriculas distintas this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; this.matricula2 = (Matricula)FabricaEntidades.ObtenerMatricula(); this.matricula2.Id = 2; this.matricula2.Costo = 4500; //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoeliminarItem(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona); this.pruebaComandoVacio3 = (ComandoeliminarItem)FabricaComandos.CrearComandoeliminarItem(); this.pruebaComandoVacio4 = (ComandoeliminarItem) FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona); //valor para Eliminar un Implemento this.pruebaComandoImplemento1 = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona); this.pruebaComandoImplemento2 =FabricaComandos.CrearComandoeliminarItem(1, this.implemento2, this.persona); //valor para Eliminar un Evento this.pruebaComandoEvento1 = FabricaComandos.CrearComandoeliminarItem( 3, this.evento, this.persona2); this.pruebaComandoEvento2 = FabricaComandos.CrearComandoeliminarItem( 3, this.evento2, this.persona2); //valor para Eliminar una Matricula this.pruebaComandoMatricula1 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona3); this.pruebaComandoMatricula2 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula2, this.persona3); //Comandos que eliminaran en la prueba de la persona4 this.pruebaComandoImplemento3 =FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona4); this.pruebaComandoEvento3 = FabricaComandos.CrearComandoeliminarItem(3, this.evento, this.persona4); this.pruebaComandoMatricula3 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona4); }
public bool verificaSeJaInserido(Matricula matricula) { matriculaControlador = MatriculaProcesso.Instance; List<Matricula> listaAuxiliar = new List<Matricula>(); listaAuxiliar = matriculaControlador.Consultar(); bool testa = false; foreach (Matricula b in listaAuxiliar) { if ((b.AlunoID == matricula.AlunoID) && (b.Ano == matricula.Ano)) { testa = true; } } return testa; }
public void Limpiar() { this.persona = null; this.persona2 = null; this.persona3 = null; this.implemento = null; this.matricula = null; this.listaEventos = null; this.PruebaComandoVacio = null; this.PruebaComandoVacio2 = null; this.pruebaComandoVacio3 = null; this.pruebaComandoVacio4 = null; this.PruebaSoloImplementos = null; this.PruebaSoloEventos = null; this.PruebaTodosItems = null; this.eventos = null; this.ComandoModificarCarrito = null; this.ComandoModificarCarrito2 = null; this.ComandoModificarCarrito3 = null; this.ComandoModificarCarrito4 = null; this.ComandoModificarCarrito5 = null; }
public void Limpiar() { this.PruebaComandoVacio = null; this.PruebaComandoVacio2 = null; this.pruebaComandoVacio3 = null; this.pruebaComandoVacio4 = null; this.pruebaComandoImplemento1 = null; this.pruebaComandoImplemento2 = null; this.pruebaComandoImplemento3 = null; this.pruebaComandoImplemento4 = null; this.pruebaComandoEvento1 = null; this.pruebaComandoEvento2 = null; this.pruebaComandoEvento3 = null; this.pruebaComandoEvento4 = null; this.pruebaComandoMatricula1 = null; this.pruebaComandoMatricula2 = null; this.pruebaComandoMatricula3 = null; this.pruebaComandoMatricula4 = null; this.eventos = null; this.persona = null; this.persona2 = null; this.persona3 = null; this.implemento = null; this.implemento2 = null; this.listaEventos = null; this.matricula = null; this.matricula2 = null; }
public List<Matricula> Consultar(Matricula matricula, TipoPesquisa tipoPesquisa) { List<Matricula> resultado = Consultar(); switch (tipoPesquisa) { #region Case E case TipoPesquisa.E: { if (matricula.ID != 0) { resultado = ((from m in resultado where m.ID == matricula.ID select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.DataMatricula.HasValue && matricula.DataMatricula.Value != default(DateTime)) { resultado = ((from m in resultado where m.DataMatricula.HasValue && m.DataMatricula.Value == matricula.DataMatricula.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.AlunoID.HasValue && matricula.AlunoID.Value != 0) { resultado = ((from m in resultado where m.AlunoID.HasValue && m.AlunoID.Value == matricula.AlunoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Aluno != null) { resultado = ((from m in resultado where m.Aluno.Nome.ToLower().Contains(matricula.Aluno.Nome.ToLower()) select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.DescontoID.HasValue) { resultado = ((from m in resultado where m.DescontoID.HasValue && m.DescontoID.Value == matricula.DescontoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.SalaPeriodoID.HasValue) { resultado = ((from m in resultado where m.SalaPeriodoID.HasValue && m.SalaPeriodoID.Value == matricula.SalaPeriodoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Valor.HasValue) { resultado = ((from m in resultado where m.Valor.HasValue && m.Valor.Value == matricula.Valor.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(matricula.NumMatricula)) { resultado = ((from m in resultado where m.NumMatricula.Contains(matricula.NumMatricula) select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Status.HasValue) { resultado = ((from m in resultado where m.Status.HasValue && m.Status.Value == matricula.Status.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } break; } #endregion #region Case Ou case TipoPesquisa.Ou: { if (matricula.ID != 0) { resultado.AddRange((from m in Consultar() where m.ID == matricula.ID select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.DataMatricula.HasValue && matricula.DataMatricula.Value != default(DateTime)) { resultado.AddRange((from m in Consultar() where m.DataMatricula.HasValue && m.DataMatricula.Value == matricula.DataMatricula.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Aluno != null) { resultado.AddRange((from m in Consultar() where m.Aluno.Nome.Contains(matricula.Aluno.Nome) select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.AlunoID.HasValue) { resultado.AddRange((from m in Consultar() where m.AlunoID.HasValue && m.AlunoID.Value == matricula.AlunoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.DescontoID.HasValue) { resultado.AddRange((from m in Consultar() where m.DescontoID.HasValue && m.DescontoID.Value == matricula.DescontoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.SalaPeriodoID.HasValue) { resultado.AddRange((from m in Consultar() where m.SalaPeriodoID.HasValue && m.SalaPeriodoID.Value == matricula.SalaPeriodoID.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Valor.HasValue) { resultado.AddRange((from m in Consultar() where m.Valor.HasValue && m.Valor.Value == matricula.Valor.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } if (!string.IsNullOrEmpty(matricula.NumMatricula)) { resultado.AddRange((from m in Consultar() where m.NumMatricula.Contains(matricula.NumMatricula) select m).ToList()); resultado = resultado.Distinct().ToList(); } if (matricula.Status.HasValue) { resultado.AddRange((from m in Consultar() where m.Status.HasValue && m.Status.Value == matricula.Status.Value select m).ToList()); resultado = resultado.Distinct().ToList(); } break; } #endregion default: break; } return resultado; }
public void PruebaCarritoSoloMatriculas() { //Agregamos Matriculas en el carrito de la persona this.daoPrueba.agregarItem(this.persona3, this.matricula, 3, 1); //Ejecutamos los metodos correspondientes para ver los items this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona3); this.EventosCarrito = this.daoPrueba.getEvento(this.persona3); this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona3); //Revisamos que solo hayan Matriculas y efectivamente haya solo una agregada Assert.IsTrue(this.ImplementosCarrito.Count == 0); Assert.IsTrue(this.EventosCarrito.Count == 0); Assert.IsTrue(this.MatriculasCarrito.Count == 1); //Obtenemos la Matricula y verificamos sus valores this.matricula = this.MatriculasCarrito.ElementAt(0).Key as Matricula; Assert.AreEqual(this.matricula.Id, 1); //Assert.AreEqual(this.matricula.Costo, 5000); //PILAS CON EL COSTO ARREGLAR Assert.AreEqual(this.MatriculasCarrito.ElementAt(0).Value, 1); }
public void Limpiar() { this.daoPrueba = null; this.persona = null; this.persona2 = null; this.persona3 = null; this.persona4 = null; this.persona5 = null; this.persona6 = null; this.implemento = null; this.implemento2 = null; this.listaEventos = null; this.matricula = null; this.matricula2 = null; this.ImplementosCarrito = null; this.EventosCarrito = null; this.MatriculasCarrito = null; this.evento = null; }