Beispiel #1
0
    static void Main(string[] args)
    {
        Director director = new Director();
        Sony     builder  = new Sony();

        director.Builder = builder;

        Console.WriteLine("Basic product:");
        director.buildBasic();
        Console.WriteLine(builder.GetProduct().ListParts());

        Console.WriteLine("Standard product:");
        director.buildStandart();
        Console.WriteLine(builder.GetProduct().ListParts());

        Console.WriteLine("Standard+ product:");
        director.buildStandartPlus();
        Console.WriteLine(builder.GetProduct().ListParts());

        Console.WriteLine("Lux product:");
        director.buildLux();
        Console.WriteLine(builder.GetProduct().ListParts());


        Console.ReadLine();
    }
Beispiel #2
0
        public Task AddSony(string Username, Sony sony)
        {
            var result = _client.Cypher
                         .Match(@"(renterer:Renterer)").Where((Renterer renterer) => renterer.Username == Username)
                         .Create("(sony:Sony {sony})").WithParams(new { sony })
                         .Create("(renterer)-[r:OWN] -> (sony)")
                         .ExecuteWithoutResultsAsync();

            return(result);
        }
Beispiel #3
0
        public async Task <Sony> GetSonyBySerialNumber(string SerialNumber)
        {
            var result = await _client.Cypher.Match(@"(sony:Sony)").Where((Sony sony) => sony.SerialNumber == SerialNumber)
                         .Return(sony => new { Sony = sony.As <Sony>() }).ResultsAsync;

            Sony sony = new Sony();

            foreach (var indeks in result)
            {
                sony = indeks.Sony;
            }
            return(sony);
        }
Beispiel #4
0
    static void Main(string[] args)
    {
        Director director = new Director();

        Dell dell = new Dell();

        director.Builder = dell;

        Console.WriteLine("Basic dell complectation:\n");
        director.Basic();
        Console.WriteLine(dell.GetComplectation().ListParts());

        Console.WriteLine("Standard dell complectation:\n");
        director.Standart();
        Console.WriteLine(dell.GetComplectation().ListParts());

        Console.WriteLine("Standard plus dell complectation:\n");
        director.Standart();
        Console.WriteLine(dell.GetComplectation().ListParts());

        Console.WriteLine("Lux dell complectation:\n");
        director.Lux();
        Console.WriteLine(dell.GetComplectation().ListParts());

        Console.WriteLine("-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\n");

        Sony sony = new Sony();

        director.Builder = sony;

        Console.WriteLine("Basic sony complectation:\n");
        director.Basic();
        Console.WriteLine(sony.GetComplectation().ListParts());

        Console.WriteLine("Standard sony complectation:\n");
        director.Standart();
        Console.WriteLine(sony.GetComplectation().ListParts());

        Console.WriteLine("Standard plus sony complectation:\n");
        director.Standart();
        Console.WriteLine(sony.GetComplectation().ListParts());

        Console.WriteLine("Lux sony complectation:\n");
        director.Lux();
        Console.WriteLine(sony.GetComplectation().ListParts());

        Console.ReadLine();
    }
        public static void Run()
        {
            TV            rca       = new RCA();
            RemoteControl remoteRCA = new ConcreteRemote(rca);

            remoteRCA.On();
            remoteRCA.SetChannel(10);
            remoteRCA.Off();

            Console.WriteLine("\nI got a new TV! Time to reprogram the remote ...");
            TV             sony       = new Sony();
            ConcreteRemote sonyRemote = remoteRCA as ConcreteRemote;

            sonyRemote.ProgramToNewTV(sony);

            sonyRemote.On();
            sonyRemote.SetChannel(10);
            sonyRemote.NextChannel();
            sonyRemote.NextChannel();
            sonyRemote.PreviousChannel();
            sonyRemote.Off();
        }
Beispiel #6
0
        public async Task <bool> IsSonyFree(string SerialNumber, string UsernameRentee)
        {
            Sony sony   = new Sony();
            var  result = await _client.Cypher
                          .Match(@"(sony:Sony {SerialNumber:" + "\"" + SerialNumber + "\"" + "})-[r:RESERVED_BY]->(rentee:Rentee {Username:"******"\"" + UsernameRentee + "\"" + "})")
                          .Return((sony) => new
            {
                Sony = sony.As <Sony>()
            })
                          .ResultsAsync;

            foreach (var indeks in result)
            {
                if (indeks.Sony != null)
                {
                    sony = indeks.Sony;
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #7
0
 public Task AddSony(string Username, Sony sony)
 {
     return this._sonyRepository.AddSony(Username, sony);
 }
Beispiel #8
0
 public Task AddSony([FromQuery] string rentererUsername, [FromBody] Sony Addsony)
 {
     //Sony sony = new Sony(Addsony.SerialNumber, Addsony.Type, Addsony.Price, Addsony.Notes);
     return(_rentererService.AddSony(rentererUsername, Addsony));
 }
Beispiel #9
0
 public AvailableSonyDTO()
 {
     this.Sony = new Sony();
 }