Пример #1
0
 public void IntraInFrizerie(Frizerie frizerie)
 {
     if (frizerie.Clienti == null)
     {
         frizerie.Clienti = new List <Client>();
     }
     frizerie.Clienti.Add(this);
     Console.WriteLine($"Clientul cu numele {this.Nume} a intrat in frizeria {frizerie.Nume}");
 }
Пример #2
0
        static void Main(string[] args)
        {
            //create obiecte
            Frizerie FrizeriaMea = new Frizerie();

            FrizeriaMea.Clienti = new List <Client>();
            FrizeriaMea.Frizeri = new List <Frizer>();
            Client client1 = new Client("Gigel");
            Client client2 = new Client("Ionut");
            Client client3 = new Client("Marius");
            Client client4 = new Client("Ion");
            Frizer frizer1 = new Frizer("Tara", Sex.Feminin, 2);

            FrizeriaMea.Frizeri.Add(frizer1);
            frizer1.IntraInTura();
            Frizer frizer2 = new Frizer("Matei", Sex.Masculin, 1);

            FrizeriaMea.Frizeri.Add(frizer2);
            frizer2.IntraInTura();
            Frizer frizer3 = new Frizer("Mirel", Sex.Masculin, 4);

            FrizeriaMea.Frizeri.Add(frizer3);
            frizer3.IntraInTura();
            Frizer frizer4 = new Frizer("Bari", Sex.Masculin, 6);

            FrizeriaMea.Frizeri.Add(frizer4);
            frizer4.IntraInTura();
            //folosire obiecte
            Programare programare = client1.FaceProgramare(frizer1, DateTime.Now);

            client1.IntraInFrizerie(FrizeriaMea);
            if (frizer1.TundeClient(programare))
            {
                client1.IeseDinFrizerie();
            }

            Programare programare1 = client2.FaceProgramare(frizer2, DateTime.Now);

            client2.IntraInFrizerie(FrizeriaMea);
            if (frizer2.TundeClient(programare1))
            {
                client2.IeseDinFrizerie();
            }

            Programare programare2 = client3.FaceProgramare(frizer3, DateTime.Now);

            client3.IntraInFrizerie(FrizeriaMea);
            if (frizer3.TundeClient(programare2))
            {
                client3.IeseDinFrizerie();
            }

            Programare programare3 = client4.FaceProgramare(frizer4, DateTime.Now);

            client4.IntraInFrizerie(FrizeriaMea);
            if (frizer4.TundeClient(programare3))
            {
                client4.IeseDinFrizerie();
            }

            frizer1.IeseDinTura();
            frizer2.IeseDinTura();
            frizer3.IeseDinTura();
            frizer4.IeseDinTura();
            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Client client1 = new Client();

            client1.Nume    = "Vasile";
            client1.Prenume = "Dragos";

            Client client2 = new Client();

            client2.Nume    = "Motomeanu";
            client2.Prenume = "Marius";

            Client client3 = new Client();

            client3.Nume    = "Ghilicica";
            client3.Prenume = "Bogdan";

            Client client4 = new Client();

            client4.Nume    = "Musat";
            client4.Prenume = "Ciprian";

            Client client5 = new Client();

            client5.Nume    = "Visescu";
            client5.Prenume = "Adrian";

            Client client6 = new Client();

            client6.Nume    = "Leonte";
            client6.Prenume = "Ionut";

            Frizer frizer1 = new Frizer();

            frizer1.Nume        = "Fuerea";
            frizer1.Prenume     = "Marin";
            frizer1.Schimb      = "1";
            frizer1.Dexteritate = "Expert";

            Frizer frizer2 = new Frizer();

            frizer2.Nume        = "Calciu";
            frizer2.Prenume     = "Petrut";
            frizer2.Schimb      = "1";
            frizer2.Dexteritate = "Incepator";

            Frizer frizer3 = new Frizer();

            frizer3.Nume        = "Valcu";
            frizer3.Prenume     = "Florin";
            frizer3.Schimb      = "1";
            frizer3.Dexteritate = "Mediocru";

            Frizer frizer4 = new Frizer();

            frizer4.Nume        = "Rusen";
            frizer4.Prenume     = "George";
            frizer4.Schimb      = "2";
            frizer4.Dexteritate = "Mediocru";

            Frizer frizer5 = new Frizer();

            frizer5.Nume        = "Craciun";
            frizer5.Prenume     = "Ion";
            frizer5.Schimb      = "2";
            frizer5.Dexteritate = "Expert";

            ScaunFrizerie scaun1 = new ScaunFrizerie();

            scaun1.FrizerDisponibil = Schimb();

            Frizerie frizerie = new Frizerie();

            frizerie.Nume = "Barber Shop";

            bool Schimb(Frizer schimb)
            {
                if ((Frizerie.timp < 540) && (Frizerie.timp > 1200))
                {
                    Console.WriteLine($"Frizeria {frizerie.Nume} este inchisa, va rugam sa consultati programul.");
                    return(false);
                }
                else if ((Frizerie.timp >= 540) && (Frizerie.timp <= 1200))
                {
                    if (Frizerie.timp < 1020)
                    {
                        Console.WriteLine("In frizerie se lucreaza schimbul 1");
                        return(true);
                    }
                    else
                    {
                        Console.WriteLine("In frizerie se lucreaza schimbul 2");
                        return(true);
                    }
                }
            }
        }