private void txtCodigo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (txtCodigo.Text.Trim() == "") { return; } string IdAModificar = txtCodigo.Text.Trim(); Legajo LegajoAModificar = new Legajo(); LegajoAModificar = L.BuscarUno(IdAModificar); if (LegajoAModificar.Codigo == 0) { return; } AgModLegajo AgMod = new AgModLegajo(LegajoAModificar) { StartPosition = FormStartPosition.CenterScreen }; AgMod.Show(); txtCodigo.Text = ""; } else if (e.KeyData == Keys.Escape) { txtCodigo.Text = ""; } }
private Dictionary <string, object> ParametroLegajo(Legajo legajo) { return(new Dictionary <string, object> { { LEGAJO, legajo.AsInt() } }); }
public void VerificarAntiguedadMes(DateTime ingreso, int antiguedadEsperada) { Alumno local = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", ingreso); int antiguedad = local.Antiguedad(Formato.Mes); antiguedad.Should().Be(antiguedadEsperada); }
public void BuscarTelefonosDuplicadosEnTodosLosAlumnos() { Alumno local1 = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); Alumno local2 = new AlumnoLocal(Legajo.Of("1233"), "Pedro", "Martinez", new DateTime(2019, 1, 1)); Alumno local3 = new AlumnoLocal(Legajo.Of("12344"), "Juan", "Martinez", new DateTime(2019, 1, 1)); var tel1 = Telefono.Of("011", "1234"); var tel2 = Telefono.Of("012", "43123"); local1.AgregarTelefono(tel1); local2.AgregarTelefono(tel2); local3.AgregarTelefono(tel1); List <Alumno> alumnos = new List <Alumno>(); alumnos.Add(local1); alumnos.Add(local2); alumnos.Add(local3); //SOLO IMPORTA ESTO. //Busca en todos los telefonos de los alumnos los que tengan el mismo prefijo y numero. //Devuelve una lsita de los alumnos que cumplan con esa condicion. //Podes verificar que la lista este vacia para validarlo, si te devuelve un Count distitno de cero //podes usar los datos del alumno para tirar una excepcion. var list = alumnos.Where(alumno => alumno.Telefonos.Any(telefono => telefono.Prefijo == tel1.Prefijo && telefono.Numero == tel1.Numero)).ToList(); // list.Should().ContainInOrder(local1, local3).And.HaveCount(2); }
private void _AbrirModificarLegajo(DataGridView grid) { try { if (grid.SelectedRows.Count != 1) { throw new Exception("Se debe seleccionar una fila a modificar"); } string IdAModificar = grid.SelectedRows[0].Cells["Codigo"].Value.ToString(); Legajo LegajoAModificar = new Legajo(); LegajoAModificar = L.BuscarUno(IdAModificar); AgModLegajo AgMod = new AgModLegajo(LegajoAModificar) { StartPosition = FormStartPosition.CenterScreen }; AgMod.ShowDialog(); //ActualizarGrilla(); } catch (Exception err) { MessageBox.Show(err.Message, "Error"); } }
private void TB_Buscar_Click(object sender, EventArgs e) { try { if (TB_CodLegajo.Text == "" || TB_Año.Text == "") { throw new Exception("Se deben cargar los datos de legajo y año"); } dtCronograma = Cr.BuscarUno(TB_CodLegajo.Text, TB_Año.Text); Legajo _L = new Legajo(); _L = _L.BuscarUno(TB_CodLegajo.Text); TB_DesLegajo.Text = _L.Descripcion; lblAtencion.Visible = false; if (dtCronograma.Rows.Count == 0) { dtCronograma = L.BuscarCursosPlanificacion(TB_CodLegajo.Text); // Mostramos la ventana de Atencion. lblAtencion.Visible = true; } DGV_Crono.DataSource = dtCronograma; } catch (Exception err) { MessageBox.Show(err.Message, "Error"); } }
private void TB_CodLegajo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { TB_CodLegajo.Text = ""; TB_DesLegajo.Text = ""; } if (e.KeyCode == Keys.Enter) { if (TB_CodLegajo.Text.Trim() != "") { Legajo _Leg = (new Legajo()).BuscarUno(TB_CodLegajo.Text); if (_Leg.Codigo != 0) { TB_DesLegajo.Text = _Leg.Descripcion.Trim(); TB_Año.Focus(); } else { TB_DesLegajo.Text = ""; } } } }
public void CompararDosIdentificadoresDelDiferenteTiposYMismoNumeroDebeDevolverFalso() { IIdentificador id1 = Dni.Of("1"); IIdentificador id2 = Legajo.Of("1"); id1.Should().NotBe(id2); }
public List <AsistenciaTecnica> ObtenerPorTecnico(Legajo legajo) { return(_accesoADatos.Leer(ObtenerPorLegajoTecnico, ParametroLegajo(legajo)) .AsEnumerable() .Select(ToAsistencia) .ToList()); }
public void AgregarTelefonoAAlumno_TelefonoNoDuplicado_AgregaTelefonoALista() { Alumno alumno = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); var telefono = new Telefono("011", "48603242"); alumno.AgregarTelefono(telefono); alumno.Telefonos.Should().Contain(telefono).And.HaveCount(1); alumno = null; }
public void CrearAlumnoLocal() { Alumno alumno = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); alumno.Le.Should().Be(Legajo.Of("123")); alumno.Nombre.Should().Be("Lisandro"); alumno.Apellido.Should().Be("Martinez"); alumno.FechaIngreso.Should().Be(1.January(2019)); }
public void AgregarTelefonoAAlumno_TelefonoDuplicado_TiraExcepcion() { Alumno alumno = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); alumno.AgregarTelefono(new Telefono("011", "48603242")); Action act = () => alumno.AgregarTelefono(new Telefono("011", "48603242")); act.Should().Throw <TelefonoDuplicadoException>() .WithMessage("El telefono 011-48603242 ya se encuentra presente en el alumno"); }
public void EliminarTelefonoNull() { Alumno alumno = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); var telefono = new Telefono("011", "48603242"); alumno.AgregarTelefono(telefono); alumno.Telefonos.Should().Contain(telefono).And.HaveCount(1); alumno = null; telefono.Should().BeNull(); }
public void CrearVistaEntidad() { Alumno local = new AlumnoLocal(Legajo.Of("123"), "Lisandro", "Martinez", new DateTime(2019, 1, 1)); Alumno extra = new AlumnoExtranjero(Dni.Of("1"), "Lisandro", "Martinez", new DateTime(2019, 1, 1), "UNAM", 25); List <Alumno> lista = new List <Alumno>(); lista.Add(local); lista.Add(extra); var listaVistaEntidades = lista.Select(alumno => new VistaEntidad(alumno)).ToList(); }
//private int indexRow; public AgModLegajo() { InitializeComponent(); Legajo _L = new Legajo(); TB_Codigo.Text = _L.ObtenerUltimoId().ToString(); tabControl1.TabPages.Remove(tabPage3); CargarSectores(); CargarPerfil(); Cargado = true; //CargarCursadas(); }
public async Task <IActionResult> Create(LegajoViewModel vm) { if (ModelState.IsValid) { var legajo = new Legajo { Nombre = vm.Nombre, Apellido = vm.Apellido, Categoria = vm.Categoria, CUIL = vm.CUIL, FechaIngreso = vm.FechaIngreso }; _context.Add(legajo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Details), "Legajos", new { id = legajo.NumeroLegajo })); } return(View(vm)); }
private void TB_Codigo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (TB_Codigo.Text.Trim() == "") { return; } Legajo LegajoAModificar = new Legajo(); LegajoAModificar = L.BuscarUno(TB_Codigo.Text); _CargarLegajo(LegajoAModificar); TB_DescLegajo.Focus(); } else if (e.KeyData == Keys.Escape) { TB_Codigo.Text = ""; } }
private void _CargarLegajo(Legajo LegajoAModificar) { Conexion cn = new Conexion(); cn.Modificar("update Cursadas set anoII = SUBSTRING(ordFecha,0,5) where ISNULL(anoII, '') = ''"); cn.Modificar("update Cursadas set Cursadas.DesCurso = Curso.Descripcion FROM Cursadas, Curso where Curso.Codigo = Cursadas.Curso And ISNULL(Cursadas.DesCurso, '') = ''"); cn.Modificar("update Cursadas set Cursadas.DesTema = Tema.Descripcion FROM Cursadas, Tema where Tema.Curso = Cursadas.Curso And Tema.Tema = Cursadas.Tema And ISNULL(Cursadas.DesTema, '') = ''"); L = LegajoAModificar; LegajoViejo = LegajoAModificar; CargarSectores(); CargarPerfil(); Cargado = true; AModificar = L.Codigo != 0; CargarDatosABM(); CargarDatosPefil(); //CargarTemas(L.Temas); CargarTemas(Per.Temas); CargarDatosLegajoVer(); CargarObservaciones(); TB_DescPerfil.Enabled = false; TB_CodSector.Enabled = false; TB_DescSec.Enabled = false; //Cargo cursos realizados de cursadas CargarCursadas(); ComprobarModifPerfil(); //TB_FechaIng.Enabled = false; if (TB_FechaEgreso.BackColor == Color.Red) { InhabilitarModifiaciones(); } }
private void ValidarDatosIngresados() { if (TB_CodLegajo.Text == "") { throw new Exception("Debe estar cargado el campo Legajo"); } Legajo leg = (new Legajo()).BuscarUno(TB_CodLegajo.Text); if (leg.Codigo == 0) { throw new Exception("Debe cargar un legajo válido."); } if (TB_Año.Text == "") { throw new Exception("Debe estar cargado el campo año"); } if (DGV_Crono.Rows.Count == 0) { throw new Exception("No hay datos en la grilla"); } }
public AgModLegajo(Legajo LegajoAModificar) { InitializeComponent(); _CargarLegajo(LegajoAModificar); }
public List <AsistenciaTecnica> ObtenerAsistenciasUsuario(Legajo legajo) { return(_repositorio.ObtenerPorLegajo(legajo)); }
public List <AsistenciaTecnica> ObtenerAsistenciasJefe(Legajo legajo) { return(_repositorio.ObtenerTodos()); }
public override string ToString() { return(Legajo.ToString()); }
public Dictionary <TipoProblemaId, EstadisticaTecnico> ObtenerPorTipoProblemaId(Legajo legajo) { throw new NotImplementedException(); }
public override int GetHashCode() { return(Id.GetHashCode() & ApYNom.GetHashCode() & EstaEliminado.GetHashCode() & Dni.GetHashCode() & Dni.GetHashCode() & FechaNacimiento.GetHashCode() & Telefono.GetHashCode() & Celular.GetHashCode() & Legajo.GetHashCode() & FechaIncio.GetHashCode() & CategoriaId.GetHashCode() & CUIT.GetHashCode()); }
public Dictionary <TipoProblemaId, EstadisticaTecnico> ObtenerEstadisticasDeTecnico( TipoProblemaId tipoProblemaId, Legajo legajo) { return(_estadisticasTecnicoRepositorio.ObtenerPorTipoProblemaId(legajo)); }