private void ReinstateElectrical(QuickElectrical quickElectrical)
 {
     var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
         cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) => { mViewModel.ProcessSearchFilter(); };
         cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.ElectricalEquipment, quickElectrical.Id, true, CMS.User.Id);
 }
Beispiel #2
0
        private void RemovePipe(QuickPipe quickPipe)
        {
            if (!CMS.EffectivePrivileges.PipeTab.CanDelete && !CMS.EffectivePrivileges.AdminTab.CanModify)
            {
                return;
            }

            var popupDialog = new AddPipeRevisionHistoryDialog(quickPipe.Id, quickPipe.Name);
            popupDialog.Show();
            popupDialog.Closed +=
                (s2, e2) =>
                {
                    if (popupDialog.DialogResult.HasValue && popupDialog.DialogResult.Value)
                    {
                        var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                        cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) =>
                        {
                            //Calls MainPage.CloseTab()
                            EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(quickPipe);
                        };
                        cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.Pipe, quickPipe.Id, false, CMS.User.Id);
                    }

                };
        }
Beispiel #3
0
        private void RemoveMechanicalEquipment(QuickMechanical quickMechanical)
        {
            if (!CMS.EffectivePrivileges.MechanicalTab.CanDelete && !CMS.EffectivePrivileges.AdminTab.CanModify)
            {
                return;
            }

            //PopupDialog popupDialog = new PopupDialog(PopupDialogType.ConfirmDelete,
            //                                          String.Format("Delete '{0}' Mechanical Equipment?", quickMechanical.Name));

            var dialog = new AddMechanicalRevisionHistoryDialog(quickMechanical.Id, quickMechanical.Name);
            dialog.Show();
            dialog.Closed +=
                (s1, e1) =>
                {
                    if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                    {
                        var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                        cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) =>
                        {
                            //Calls MainPage.CloseTab()
                            EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(quickMechanical);
                        };
                        cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.MechanicalEquipment, quickMechanical.Id, false, CMS.User.Id);
                    }
                };
        }
 private void RemoveButtonHandler(object parameter)
 {
     var popupDialog = new AddInstrumentRevisionHistoryDialog(Instrument.Id, Instrument.Name);
     popupDialog.Show();
     popupDialog.Closed +=
         (s2, e2) =>
         {
             if (popupDialog.DialogResult.HasValue && popupDialog.DialogResult.Value)
             {
                 var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                 cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s1, e1) =>
                 {
                     //Calls mainpage.CloseTab();
                     EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(new QuickInstrument {Id = Instrument.Id, Name = Instrument.Name});
                     EventAggregator.GetEvent<PrismEvents.RefreshNavigationEvent>().Publish(new QuickInstrument());
                 };
                 cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.Instrument, Instrument.Id, false, CMS.User.Id);
             }
         };
 }
 private void ReinstateControlSystem(QuickControlSystem quickControlSystem)
 {
     CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
     cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) =>
     {
         quickControlSystem.IsActive = true;
         EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(quickControlSystem);
     };
     cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.Control, quickControlSystem.Id, true, CMS.User.Id);
 }
 private void DeleteCommandHandler(object parameter)
 {
     var popupDialog = new AddControlSystemRevisionHistoryDialog(ControlSystem.Id, ControlSystem.Name);
     popupDialog.Show();
     popupDialog.Closed +=
         (s2, e2) =>
         {
             if (popupDialog.DialogResult.HasValue && popupDialog.DialogResult.Value)
             {
                 var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                 cmsWebServiceClient.SaveIsActiveEquipmentStateCompleted += (s, e) =>
                 {
                     //Calls MainPage.CloseTab()
                     EventAggregator.GetEvent<PrismEvents.CloseTabPrismEvent>().Publish(new QuickControlSystem {Id = ControlSystem.Id, Name = ControlSystem.Name});
                     EventAggregator.GetEvent<PrismEvents.RefreshNavigationEvent>().Publish(new QuickControlSystem());
                 };
                 cmsWebServiceClient.SaveIsActiveEquipmentStateAsync(CommonUtils.ModelType.Control, ControlSystem.Id, false, CMS.User.Id);
             }
         };
 }