Пример #1
0
      private void _btnOkOnClick(object sender, EventArgs e) {
         _importedIds = new List<BplIdentity>();

         foreach (var line in txtDevices.Lines) {
            var idStrs = line.Split(new Char[] { ',' });
            foreach (var idStr in idStrs) {
               var id = idStr.Trim();
               if (id == "") {
                  continue;
               }

               _importedIds.Add(BplIdentity.Get(id));
            }
         }

         if (_importedIds.Count == 0) {
            return;
         }
         _importAsDevices = btnDevices.Checked;

         var req = new GetDevicesByPlatformId();
         req.PlatformId = _platformId;
         SendRequest(req);
      }
Пример #2
0
 internal void Handle(GetDevicesByPlatformId request) {
    using (var dbConn = DatabaseManager.DbConn()) {
       var devices = dbConn.ExecuteBpl(new DeviceGetByPlatformId { PlatformId = request.PlatformId });
       Reply(devices);
    }
 }
Пример #3
0
      private void _onLoad(object sender, EventArgs e) {
         cmbOpco.DataSource = _opcosComboList;
         cmbOpco.DisplayMember = "Name";

         SetSort(listBoxes, 0);

         if (_platformId.IsEmpty) {
            var req = new GetAllDevices();
            SendRequest(req);
         } else {
            var req = new GetDevicesByPlatformId();
            req.PlatformId = _platformId;
            SendRequest(req);
         }
      }