Example #1
0
        private void startGroupRegistration()
        {
            currentCase = accessory as Cases;

            if (currentCase.Lamp == 0 || currentCase.ElectronicUnit == 0)
            {
                ShowMessage("Нужно заполнить лампу и эл. блок!");
                return;
            }

            if (!(accessory is Cases))
            {
                return;
            }

            currentLamp = new Lamps();
            currentLamp.Read(currentCase.Lamp);

            currentUnit = new ElectronicUnits();
            currentUnit.Read(currentCase.ElectronicUnit);

            if (!string.IsNullOrEmpty(currentLamp.BarCode) || !string.IsNullOrEmpty(currentUnit.BarCode))
            {
                ShowMessage("Для групової реєстрації лампа та блок мають бути без штрих-коду");
                return;
            }

            if (isMainDataEntered && warrantlyDataIsValid())
            {
                accessory.Write();
            }
            else
            {
                showWriteErrorMessage();
                return;
            }

            groupRegistration = true;

            currentCase = new Cases();
            currentCase.Read(accessory.Id);

            groupRegistrationButton.Hide();
            groupSizeLabel = MainProcess.CreateLabel("", 5, 283, 230,
                                                     MobileFontSize.Normal, MobileFontPosition.Left, MobileFontColors.Info, FontStyle.Bold);
            groupSize = 0;
        }