コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: barrett2474/CMS2
        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);
                    }

                };
        }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: barrett2474/CMS2
        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);
                    }
                };
        }
コード例 #4
0
 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);
             }
         };
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
             }
         };
 }