Exemplo n.º 1
0
 private void CreateNew()
 {
     Vortex.Presentation.Wpf.ActionRunner.Runner.Execute(() =>
     {
         var plainer       = ((dynamic)DataExchange)._data.CreatePlainerType();
         plainer._EntityId = RecordIdentifier;
         DataBrowser.AddRecord(plainer);
         var plain = DataBrowser.FindById(plainer._EntityId);
         ((dynamic)DataExchange)._data.CopyPlainToShadow(plain);
         FillObservableRecords();
         SelectedRecord = plain;
         this.Mode      = ViewMode.Edit;
     });
 }
Exemplo n.º 2
0
 void LoadFromPlc()
 {
     Vortex.Presentation.Wpf.ActionRunner.Runner.Execute(() =>
     {
         var plainer = ((dynamic)DataExchange)._data.CreatePlainerType();
         ((dynamic)DataExchange)._data.FlushOnlineToPlain(plainer);
         plainer._EntityId = $"{DataHelpers.CreateUid().ToString()}";
         DataBrowser.AddRecord(plainer);
         var plain = DataBrowser.FindById(plainer._EntityId);
         ((dynamic)DataExchange)._data.CopyPlainToShadow(plain);
         FillObservableRecords();
         SelectedRecord = plain;
         this.Mode      = ViewMode.Edit;
     }, "", () => MessageBox.Show($"{strings.WouldYouLikeToGetFromPLC}", "Data", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes);
 }