Exemplo n.º 1
0
        internal NbtCompound GetNbtObject()
        {
            NbtCompound ticket = new NbtCompound();

            if (Od > Do && Do.ToString("H:mm") != "0:00")
            {
                Od = Od.AddHours(-12);
                Do = Do.AddHours(12);
            }

            ticket.Add(new NbtByte("Den", (byte)Datum.Day));
            ticket.Add(new NbtByte("Do h", (byte)Do.Hour));
            ticket.Add(new NbtByte("Do m", (byte)Do.Minute));
            ticket.Add(new NbtByte("Od h", (byte)Od.Hour));
            ticket.Add(new NbtByte("Od m", (byte)Od.Minute));
            ticket.Add(new NbtByte("Prace", TypPrace));
            ticket.Add(new NbtByte("Stav", (byte)StavT));
            ticket.Add(new NbtShort("Rok", (short)Datum.Year));
            ticket.Add(new NbtLong("IDlong", IDtick));
            ticket.Add(new NbtString("ID", ID));
            ticket.Add(new NbtString("Kontakt", Kontakt));
            ticket.Add(new NbtString("PC", PC));
            ticket.Add(new NbtString("Popis", Popis));
            ticket.Add(new NbtString("Poznamky", Poznamky));
            ticket.Add(new NbtString("Terp", CustomTerp));
            ticket.Add(new NbtString("Task", CustomTask));
            ticket.Add(new NbtString("OnlineTyp", OnlineTyp));
            List <byte> poh = new List <byte>();
            List <byte> pom = new List <byte>();

            foreach (DateTime b in PauzyOd)
            {
                poh.Add((byte)b.Hour);
                pom.Add((byte)b.Minute);
            }
            List <byte> pdh = new List <byte>();
            List <byte> pdm = new List <byte>();

            foreach (DateTime b in PauzyDo)
            {
                pdh.Add((byte)b.Hour);
                pdm.Add((byte)b.Minute);
            }
            ticket.Add(new NbtByteArray("Pauza do h", pdh.ToArray()));
            ticket.Add(new NbtByteArray("Pauza do m", pdm.ToArray()));
            ticket.Add(new NbtByteArray("Pauza od h", poh.ToArray()));
            ticket.Add(new NbtByteArray("Pauza od m", pom.ToArray()));

            return(ticket);
        }