private void SetState(ItemState value) { var namesList = ALData.GetItemStateNamesList(ItemType.Nutrition); fView.StateCombo.AddRange(namesList, false); fView.StateCombo.SetSelectedTag <ItemState>(value); }
private void SetState(ItemType itemType, ItemState itemState) { var namesList = ALData.GetItemStateNamesList(itemType); fView.StateCombo.AddRange(namesList, false); fView.StateCombo.SetSelectedTag(fRecord.State); }
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); } }