public void ReloadObjects() { Devices = BcDevicesStorageExtensions.LoadAll(); _objects = BcObjects.LoadAll(); lvObjects.Items.Clear(); foreach (BcDevices bcDevices in Devices) { lvObjects.Items.Add(bcDevices.Name); lvObjects.Items[lvObjects.Items.Count - 1].Value = bcDevices.Id; lvObjects.Items[lvObjects.Items.Count - 1].Description = bcDevices.Name; } }
public FrmDevices(List <BcDevices> devs) { this.InitializeComponent(); try { this._objects = BcObjects.LoadAll(); BcDevices[] array = new BcDevices[devs.Count]; devs.CopyTo(array, 0); this.ActiveDevices.AddRange((IEnumerable <BcDevices>)array); FrmImages.SqlServerState = true; } catch (Exception ex) { int num = (int)XtraMessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Hand); FrmImages.SqlServerState = false; } }
private void RefreshForm() { _dtmain.Dispose(); _dtmain = new DataTable(); _dtmain.Columns.AddRange(new DataColumn[4] { new DataColumn("ID"), new DataColumn("Name"), new DataColumn("Comment"), new DataColumn("Data") }); _objects = BcObjects.LoadAll(); foreach (BcObjects bcObjects in _objects) { _dtmain.Rows.Add((object)bcObjects.Id, (object)bcObjects.Name, (object)bcObjects.Comment, (object)bcObjects.Data); } gridControl1.DataSource = _dtmain; }
public void ReloadObjects() { try { Results.dtImageType.Rows.Clear(); Results.dtCategories.Rows.Clear(); Results.dtDevices.Rows.Clear(); Devices = BcDevicesStorageExtensions.LoadAll(); _objects = BcObjects.LoadAll(); _bases = BcLogBases.LoadAll(); lvObjects.Items.Clear(); foreach (BcDevices bcDevices in Devices) { lvObjects.Items.Add(""); lvObjects.Items[lvObjects.Items.Count - 1].Value = bcDevices.Id; lvObjects.Items[lvObjects.Items.Count - 1].Description = bcDevices.Name + "-"; foreach (BcObjects bcObjects in _objects) { if (bcObjects.Id == bcDevices.ObjectId) { bcObjects.GetData(); if (bcDevices.TableId != Guid.Empty) { CheckedListBoxItem checkedListBoxItem = lvObjects.Items[lvObjects.Items.Count - 1]; string str1 = checkedListBoxItem.Description + "(" + bcObjects.Name + "-" + BcObjectsData.GetObjectById(bcObjects.Data, bcDevices.TableId).Name + ")"; checkedListBoxItem.Description = str1; string str2 = bcObjects.Name + "-" + BcObjectsData.GetObjectById(bcObjects.Data, bcDevices.TableId).Name; Results.dtDevices.Rows.Add((object)bcDevices.Id, (object)bcDevices.Name, (object)bcDevices.ObjectId, (object)bcDevices.TableId, (object)str2); break; } lvObjects.Items[lvObjects.Items.Count - 1].Description += bcObjects.Name; string str = "(" + bcObjects.Name + ")"; Results.dtDevices.Rows.Add((object)bcDevices.Id, (object)bcDevices.Name, (object)bcDevices.ObjectId, (object)bcDevices.TableId, (object)str); break; } } } } catch { } }
public FrmDevices() { this.InitializeComponent(); this._objects = BcObjects.LoadAll(); }