예제 #1
0
 public Consultatie()
 {
     this.b    = new Boala();
     this.p    = new Pacient();
     this.zi   = 1;
     this.luna = 1;
     this.an   = 2000;
 }
예제 #2
0
 public Consultatie(Boala b, Pacient p, int zi, int luna, int an)
 {
     this.b    = b;
     this.p    = p;
     this.zi   = zi;
     this.luna = luna;
     this.an   = an;
 }
예제 #3
0
        //Metoda pentru citirea tuturor consultatiilor dintr-un  fisier Medic.txt
        public String ReadFromFile()
        {
            String msg = "Fisier gol";
            //try
            //{

            StreamReader br = new StreamReader("D:\\Visual Studio\\repos\\MedicDeFamilie\\read.txt");

            String line = null;

            while ((line = br.ReadLine()) != null)
            {
                char[]   separator  = { ',' };
                String[] components = line.Split(separator, StringSplitOptions.RemoveEmptyEntries);

                String stringzi     = components[0].Trim();
                String stringluna   = components[1].Trim();
                String stringan     = components[2].Trim();
                String nume         = components[3].Trim();
                String prenume      = components[4].Trim();
                String stringvarsta = components[5].Trim();
                String adresa       = components[6].Trim();
                String numeBoala    = components[7].Trim();
                String tratament    = components[8].Trim();
                int    zi           = Int32.Parse(stringzi);
                int    luna         = Int32.Parse(stringluna);
                int    an           = Int32.Parse(stringan);
                int    varsta       = Int32.Parse(stringvarsta);
                Boala  b            = new Boala();
                b.AddElm(tratament);
                b.setNumeBoala(numeBoala);
                Pacient p = new Pacient();
                p.setVarsta(varsta);
                p.setAdresa(adresa);
                p.setNume(nume);
                p.setPrenume(prenume);
                p.AddElm(b);
                Consultatie c = new Consultatie(b, p, zi, luna, an);
                AddElm(c);
                Comparare(p);
            }
            if (repo.Count() != 0)
            {
                msg = "Citire reusita";
            }

            br.Close();

            //}
            //catch (IOException e)
            //	{
            //		msg = "Eroare";
            //}
            return(msg);

            //for (int i = 0; i < repo.Count(); i++)
            //Console.WriteLine("|%-28.8s",repo.ElementAt(i).getZi(), repo.ElementAt(i).getLuna(), repo.ElementAt(i).getAn(), repo.ElementAt(i).getP().getNume(), repo.ElementAt(i).getP().getPrenume());
        }
예제 #4
0
 public void AddElm(Boala b)
 {
     this.boli.Add(b);
 }
예제 #5
0
 public void setB(Boala b)
 {
     this.b = b;
 }