Ejemplo n.º 1
0
        public override void CardId(string id)
        {
            Action a = () =>
            {
                user = CardManager.getUser(id);
                if (user == null)
                {
                    cardReader.Read(CardId);
                    showMessage("User is not found / Пользователь не найден");
                    return;
                }
                equipments = Connector1C.getListOfEquipment(user);
                waititngCardLabel.Visible       = false;
                waititngCardLabelRus.Visible    = false;
                CardPanel.BackgroundImage       = Properties.Resources.tick;
                CardPanel.BackgroundImageLayout = ImageLayout.Zoom;
                label1.Visible        = true;
                label1.Text           = user.Name + ", choose equipment that you lost (выберите утерянное оборудование):";
                EquipmentList.Visible = true;
                if (equipments != null)
                {
                    for (int i = 0; i < equipments.Count(); i++)
                    {
                        EquipmentList.Items.Add(equipments[i].Name);
                    }
                }
            };

            BeginInvoke(a);
        }
Ejemplo n.º 2
0
        public override void CardId(string id)
        {
            Action a = () =>
            {
                if (firstUser == null)
                {
                    cardReader.Read(CardId);
                    firstUser = CardManager.getUser(id);
                    if (firstUser == null)
                    {
                        showMessage("User is not found / Пользователь не найден");
                        return;
                    }
                    equipments = Connector1C.getListOfEquipment(firstUser);
                    waititngFirstCardLabel.Visible       = false;
                    waititngFirstCardLabelRus.Visible    = false;
                    FirstCardPanel.BackgroundImage       = Properties.Resources.tick;
                    FirstCardPanel.BackgroundImageLayout = ImageLayout.Zoom;
                    label1.Visible        = true;
                    label1.Text           = "Choose equipment of (Выберите оборудование)" + firstUser.Name + ":";
                    EquipmentList.Visible = true;
                    if (equipments != null)
                    {
                        for (int i = 0; i < equipments.Count(); i++)
                        {
                            EquipmentList.Items.Add(equipments[i].Name);
                        }
                    }
                    SecondCardPanel.Enabled = true;
                }
                else
                {
                    secondUser = CardManager.getUser(id);
                    if (secondUser == null || firstUser.Id == secondUser.Id)
                    {
                        cardReader.Read(CardId);
                        showMessage("User is not found / Пользователь не найден");
                        return;
                    }
                    waititngSecondCardLabel.Visible       = false;
                    waititngSecondCardLabelRus.Visible    = false;
                    SecondCardPanel.BackgroundImage       = Properties.Resources.tick;
                    SecondCardPanel.BackgroundImageLayout = ImageLayout.Zoom;
                    label2.Visible = true;
                    label2.Text    = "New user (Новый пользователь): " + secondUser.Name;
                }
            };

            BeginInvoke(a);
        }