private void Button_ChangeComplete_Click(Object sender, EventArgs e)
        {
            RowData DeviceCompleteInfo = Devices.AllChildRows.Find("Name", DeviceName);

            if (!DeviceCompleteInfo.IsNull())
            {
                SubSectionData DeviceItems = DeviceCompleteInfo.ChildSections[MyHelper.RefUniversalItem];
                CompleteForm   Form        = new CompleteForm(DeviceName, DeviceItems, true, false, false, false, CData);
                switch (Form.ShowDialog())
                {
                case DialogResult.OK:
                    ACList = Form.ACList;
                    CData  = Form.CData;
                    ACRows = Form.ACRows;
                    Button_ChangeComplete.Enabled = true;
                    break;

                default:
                    break;
                }
            }
            else
            {
                ACRows = null;
                Button_ChangeComplete.Enabled = false;
            }
        }
        private Boolean GetDevice(Boolean IsNeedComplete = false)
        {
            Object[] activateParams = new Object[] {
                MyHelper.RefUniversalItem.ToString("B").ToUpper(),
                String.Empty,
                MyHelper.RefItem_Devices.ToString("B").ToUpper(),
                false, String.Empty, false
            };
            Object Id = Host.SelectFromCard(MyHelper.RefUniversal, "Выберите прибор...", activateParams);

            if (Id.IsNull())
            {
                return(false);
            }

            RowData DeviceItemRow = Devices.ChildSections[MyHelper.RefUniversalItem].Rows[Id.ToGuid()];

            AC = MyMessageBox.Show("Поступили только комплектующие (без прибора)?", "Комплектация", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;

            DeviceName = DeviceItemRow.GetString("Name");
            RowData DeviceCompleteInfo = Devices.AllChildRows.Find("Name", DeviceName);

            ACList = String.Empty;
            CData  = String.Empty;

            if (!DeviceCompleteInfo.IsNull())
            {
                SubSectionData DeviceItems = DeviceCompleteInfo.ChildSections[MyHelper.RefUniversalItem];
                CompleteForm   Form        = new CompleteForm(DeviceName, DeviceItems, AC, Verify, true, false);

                switch (Form.ShowDialog())
                {
                case DialogResult.OK:
                    ACList = Form.ACList;
                    CData  = Form.CData;
                    ACRows = Form.ACRows;
                    Button_ChangeComplete.Enabled = true;
                    break;

                default:
                    Button_ChangeComplete.Enabled = false;
                    if (IsNeedComplete)
                    {
                        return(false);
                    }
                    break;
                }
            }
            else
            {
                ACRows = null;
                Button_ChangeComplete.Enabled = false;
            }

            DeviceId = DeviceItemRow.Id;
            return(true);
        }
Example #3
0
        public void Move(IGame game)
        {
            var food           = new FoodDto();
            var characteristic = new CharacteristicDto();

            var inputElementForm = new InputElementForm(food);

            inputElementForm.ShowDialog();

            var completeForm = new CompleteForm(characteristic, food.Name, game.LabelCurrentNode);

            completeForm.ShowDialog();

            var newElement = new NewGameNodeDto(characteristic.Name, food.Name);

            game.AddElement(newElement);
            game.Reset();
        }