Esempio n. 1
0
        public bool WriteStickerFact(long acceptanceId, long stickerId, bool palletChanged, long cellId, long previousStickerId, long trayId, long linerId,
            int linersQuantity, int packsCount, int unitsCount)
        {
            if (palletChanged)
                {
                var sticker = new Stickers() { ReadingId = stickerId };
                sticker.Tray = new Nomenclature() { ReadingId = trayId };
                sticker.Liner = new Nomenclature() { ReadingId = linerId };
                sticker.LinersQuantity = linersQuantity;
                sticker.Quantity = packsCount;
                sticker.UnitsQuantity = unitsCount;

                if (sticker.Write() != WritingResult.Success)
                    {
                    return false;
                    }
                }

            var acceptance = new AcceptanceOfGoods() { ReadingId = acceptanceId };

            var result = acceptance.WriteStickerFact(stickerId, cellId, previousStickerId, trayId, linerId, linersQuantity, packsCount, unitsCount);
            return result;
        }
Esempio n. 2
0
        public bool CreateNewSticker(long wareId, DateTime expirationDate, int unitsQuantity, int boxesCount, long linerId, int linersCount, out long newStickerId)
        {
            var party = Parties.FindByExpirationDate(wareId, expirationDate);

            if (party.IsNull() || party.Empty)
                {
                newStickerId = 0;
                return false;
                }

            var nomenclature = new Nomenclature() { ReadingId = wareId };
            var sticker = new Stickers()
                {
                    Nomenclature = nomenclature,
                    Party = party,
                    UnitsQuantity = unitsQuantity,
                    Quantity = boxesCount,
                    ReleaseDate = party.DateOfManufacture,
                    ExpiryDate = party.TheDeadlineSuitability,
                    AcceptionDate = DateTime.Now,
                    Liner = new Nomenclature() { ReadingId = linerId },
                    LinersQuantity = linersCount
                };

            // ���������������, ��� ������� �������
            sticker.StartUnitsQuantity = nomenclature.UnitsQuantityPerPallet > unitsQuantity
                ? nomenclature.UnitsQuantityPerPallet
                : unitsQuantity;

            sticker.Write();
            newStickerId = sticker.Id;

            var stickerExists = newStickerId > 0;

            if (stickerExists)
                {
                printStickers(new List<Stickers>() { sticker });
                }

            return stickerExists;
        }
Esempio n. 3
0
        public bool SetPalletStatus(long stickerId, bool fullPallet)
        {
            var sticker = new Stickers() { ReadingId = stickerId };

            if (sticker.StartUnitsQuantity > 0)
                {
                return true;
                }

            if (fullPallet)
                {
                sticker.StartUnitsQuantity = sticker.UnitsQuantity;
                }
            else
                {
                if (sticker.Nomenclature.UnitsQuantityPerPallet > sticker.UnitsQuantity)
                    {
                    sticker.StartUnitsQuantity = sticker.Nomenclature.UnitsQuantityPerPallet;
                    }
                else
                    {
                    // �� �������� ����� �������� �� ������ ����. ���� �� ����, �������, ����� ���. ���������� ���� ������ ��������
                    sticker.StartUnitsQuantity = sticker.UnitsQuantity + 1;
                    }
                }

            return sticker.Write() == WritingResult.Success;
        }
Esempio n. 4
0
 private Stickers createSticker(Nomenclature nomenclature, Parties party, int packsQuantity, int unitsQuantity, long trayId, int startUnitsQuantity)
 {
     var sticker = new Stickers();
     sticker.Nomenclature = nomenclature;
     sticker.Quantity = packsQuantity;
     sticker.UnitsQuantity = unitsQuantity;
     sticker.Driver = Driver;
     if (trayId > 0)
         {
         sticker.SetRef("Tray", trayId);
         }
     sticker.AcceptionDate = Date;
     sticker.StartUnitsQuantity = startUnitsQuantity;
     sticker.ReleaseDate = party.DateOfManufacture;
     sticker.ExpiryDate = party.TheDeadlineSuitability;
     sticker.Party = party;
     if (sticker.Write() != WritingResult.Success)
         {
         return null;
         }
     return sticker;
 }