Esempio n. 1
0
        /// <summary>Отримати назву таблиці комплектуючого за типом</summary>
        /// <param name="type">Тип комплектуючого</param>
        /// <returns>Назва таблиці комплектуючого</returns>
        public static string GetTableNameForAccessory(TypeOfAccessories type)
            {
            Accessory accessory = null;

            switch (type)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    break;
                }

            if (accessory == null)
                {
                throw new Exception("Не знайдено тип комплектуючого!");
                }

            return accessory.GetType().Name;
            }
Esempio n. 2
0
        /// <summary>Получить визуальное представление (с информацией о элементах на которые возможны переходы)</summary>
        /// <param name="id">ID комплектующего</param>
        /// <param name="typeOfAccessories">Тип комплектующего</param>
        /// <param name="topic">Заголовок</param>
        /// <param name="listOfDetail">Словарь єлементов с детальной информацией</param>
        /// <returns>Список ...</returns>
        public static List <LabelForConstructor> GetVisualPresenter(long id, TypeOfAccessories typeOfAccessories, out string topic, out Dictionary <string, KeyValuePair <Type, object> > listOfDetail)
        {
            Accessory accessory = null;

            switch (typeOfAccessories)
            {
            case TypeOfAccessories.Lamp:
                accessory = new Lamps();
                accessory.Read <Lamps>(id);
                break;

            case TypeOfAccessories.Case:
                accessory = new Cases();
                accessory.Read <Cases>(id);
                break;

            case TypeOfAccessories.ElectronicUnit:
                accessory = new ElectronicUnits();
                accessory.Read <ElectronicUnits>(id);
                break;
            }

            return(GetVisualPresenter(typeOfAccessories, accessory, out topic, out listOfDetail));
        }
Esempio n. 3
0
        /// <summary>�������� ���������� ������������� (� ����������� � ��������� �� ������� �������� ��������)</summary>
        /// <param name="barcode">��������</param>
        /// <param name="topic">���������</param>
        /// <param name="listOfDetail">������� ��������� � ��������� �����������</param>
        /// <returns>������ ...</returns>
        public static List<LabelForConstructor> GetVisualPresenter(string barcode, out string topic, out Dictionary<string, KeyValuePair<Type, object>> listOfDetail)
        {
            TypeOfAccessories typeOfAccessories = BarcodeWorker.GetTypeOfAccessoriesByBarcode(barcode);
            Accessory accessory = null;

            switch (typeOfAccessories)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    accessory.Read<Lamps>(barcode);
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    accessory.Read<Cases>(barcode);
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    accessory.Read<ElectronicUnits>(barcode);
                    break;
                }

            return GetVisualPresenter(typeOfAccessories, accessory, out topic, out listOfDetail);
        }
Esempio n. 4
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;
        }
Esempio n. 5
0
        /// <summary>�������� ����� ������� �������������� �� �����</summary>
        /// <param name="type">��� ��������������</param>
        /// <returns>����� ������� ��������������</returns>
        public static string GetTableNameForAccessory(TypeOfAccessories type)
        {
            Accessory accessory = null;

            switch (type)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    break;
                }

            if (accessory == null)
                {
                throw new Exception("�� �������� ��� ��������������!");
                }

            return accessory.GetType().Name;
        }