コード例 #1
0
        private void SetState(ItemState value)
        {
            var namesList = ALData.GetItemStateNamesList(ItemType.Nutrition);

            fView.StateCombo.AddRange(namesList, false);
            fView.StateCombo.SetSelectedTag <ItemState>(value);
        }
コード例 #2
0
        private void SetState(ItemType itemType, ItemState itemState)
        {
            var namesList = ALData.GetItemStateNamesList(itemType);

            fView.StateCombo.AddRange(namesList, false);
            fView.StateCombo.SetSelectedTag(fRecord.State);
        }
コード例 #3
0
        public override void UpdateView()
        {
            if (fRecord != null)
            {
                fView.AquariumCombo.AddRange(fModel.QueryAquariumsList(!fRecord.IsNewRecord));
                fView.AquariumCombo.SetSelectedTag(fRecord.AquariumId);

                var pointsList = ALData.GetEntityNamesList(fModel.TSDB.GetPoints());
                fView.TSPointsCombo.AddItem(" --- ", 0);
                foreach (var item in pointsList)
                {
                    fView.TSPointsCombo.Add(item);
                }
                fView.TSPointsCombo.SetSelectedTag(fRecord.PointId);

                fView.BrandCombo.AddRange(fModel.QueryDeviceBrands(), true);
                fView.BrandCombo.Text = fRecord.Brand;

                fView.TypeCombo.SetSelectedTag(fRecord.Type);
                fView.NameField.Text       = fRecord.Name;
                fView.EnabledCheck.Checked = fRecord.Enabled;
                fView.DigitalCheck.Checked = fRecord.Digital;
                fView.PowerField.SetDecimalVal(fRecord.Power);
                fView.WorkTimeField.SetDecimalVal(fRecord.WorkTime);
                fView.NoteField.Text = fRecord.Note;

                var namesList = ALData.GetItemStateNamesList(ItemType.Device);
                fView.StateCombo.AddRange(namesList, false);
                fView.StateCombo.SetSelectedTag(fRecord.State);
            }
        }