예제 #1
0
        //Listar reparaciones
        public static List <clsReparacion> Listar()
        {
            CheckFiles();
            clsReparacion        aux;
            List <clsReparacion> reparacion = new List <clsReparacion>();
            int auxid;

            try
            {
                using (BinaryReader br = new BinaryReader(new FileStream(DIR + ARCHIVO, FileMode.Open)))
                {
                    while (br.PeekChar() != -1)
                    {
                        auxid = br.ReadInt32();
                        aux   = new clsReparacion(br.ReadString(), br.ReadString(), br.ReadDouble(), br.ReadInt32(), br.ReadInt32(), br.ReadString(), br.ReadString(), br.ReadString(), auxid, br.ReadBoolean());
                        reparacion.Add(aux);
                    }
                }
                return(reparacion);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrio un error. " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(reparacion);
            }
        }
예제 #2
0
        //Buscar reparacion por id
        public static clsReparacion Buscar(int idBuscar)
        {
            clsReparacion res = clsReparacion.Listar().Find(x => x.Id == idBuscar);

            return(res);
        }