Exemplo n.º 1
0
 public void GenetateMed()
 {
     for (int i = 1; i < 7; i++)
     {
         MedOrganization med = new MedOrganization();
         med.Id      = i;
         med.NameOrg = ((Organisation)(rand.Next(0, 6))).ToString();
         med.Address = ((Addresss)rand.Next(0, 6)).ToString();
         med.Tel     = (rand.Next(300000, 999999)).ToString();
         listMed.Add(med);
     }
 }
Exemplo n.º 2
0
        public bool Zakreplenir(ref GeterationMedSenter organ, ref GenerationPatien pat, out string message)
        {
            Console.Clear();

            foreach (Patient item in pat.listPat)
            {
                item.PrintInfo();
            }
            Console.WriteLine("");
            Patient selP = new Patient();

            Console.WriteLine("Select Patient ");
            int choiceP = Int32.Parse(Console.ReadLine());

            selP = pat[choiceP];
            Console.WriteLine("");


            foreach (MedOrganization item2 in organ.listMed)
            {
                item2.PrintInfo();
            }
            Console.WriteLine("");
            MedOrganization selM = new MedOrganization();

            Console.WriteLine("Select Med organization ");
            int choiceM = Int32.Parse(Console.ReadLine());

            selM = organ[choiceM];
            Console.WriteLine("");

            Console.Clear();

            var t = organ.listMed.FirstOrDefault(f => f.Id == choiceM);

            foreach (var p in t.patients)
            {
                if (p.IIN == choiceP)
                {
                    message = "This patient is already attached!";
                    return(false);
                }
            }

            t.patients.Add(selP);
            pat.listPat.FirstOrDefault(f => f.IIN == choiceP)
            .MedOrgan = selM;

            message = "The patient is successfully attached!";
            return(true);
        }