public MobilePlantControlViewModel(int equipmentId)
        {
            CompositionInitializer.SatisfyImports(this);

            SaveButtonCommand = new DelegateCommand<object>(SaveButtonHandler, CanModify);
            RemoveButtonCommand = new DelegateCommand<object>(RemoveButtonHandler, CanDelete);
            ExpiryPickerButton = new DelegateCommand<object>(ExpiryButtonHandler, CanDelete);

            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.GetMobilePlantCompleted += cmsWebServiceClient_GetMobilePlantCompleted;
            cmsWebServiceClient.GetMobilePlantAsync(equipmentId);

            cmsWebServiceClient.GetMobilePlantTypesCompleted += cmsWebServiceClient_GetMobilePlantTypesCompleted;
            cmsWebServiceClient.GetMobilePlantTypesAsync(false);

            //MobileHirers
            cmsWebServiceClient.GetMobileHirersCompleted += cmsWebServiceClient_GetMobileHirersCompleted;
            cmsWebServiceClient.GetMobileHirersAsync();

            //Owners
            cmsWebServiceClient.GetMobileOwnersCompleted += cmsWebServiceClient_GetMobileOwnersCompleted;
            cmsWebServiceClient.GetMobileOwnersAsync();

            cmsWebServiceClient.GetUpperEquipmentsCompleted += cmsWebServiceClient_GetUpperEquipmentsCompleted;
            cmsWebServiceClient.GetUpperEquipmentsAsync();

            Areas = new ObservableCollection<Area>(from x in CMS.Cache.Areas where x.IsActive && x.SiteId == CMS.AppSetting.DefaultSiteId select x);
        }
Example #2
0
 public static Task<List<UpperEquipment>> GetUpperEquipments()
 {
     var task = new TaskCompletionSource<List<UpperEquipment>>();
     var cee = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
     cee.GetUpperEquipmentsCompleted += (s, e) => task.SetResult(e.Result);
     cee.GetUpperEquipmentsAsync();
     return task.Task;
 }