示例#1
0
        public async Task <IActionResult> StartSync(int id)
        {
            var instance = await _instanceRepository.GetByIdAsync(id);

            var previousSync = await _syncRepository.GetLastSuccessfulSync(id);

            var newSync = _syncModelFactory.CreateModel(id, instance.Name, previousSync);

            await _syncRepository.InsertAsync(newSync);

            return(RedirectToAction("Index", "Sync"));
        }
示例#2
0
        public async Task <SyncJobCompositeModel> MakeSyncJobCompositeModelAsync(SyncModel syncModel)
        {
            var instance = await _instanceRepository.GetByIdAsync(syncModel.InstanceId);

            return(new SyncJobCompositeModel
            {
                SyncModel = syncModel,
                InstanceModel = instance
            });
        }
示例#3
0
        public async Task <IActionResult> Index(int instanceId)
        {
            var instanceModel = await _instanceRepository.GetByIdAsync(instanceId);

            var spaceList = await _spaceRepository.GetAllAsync(currentPageNumber : 1, rowsPerPage : int.MaxValue, "Name", true, instanceId);

            var viewModel = new ReportingViewModel
            {
                Instance  = instanceModel,
                SpaceList = spaceList.Items
            };

            return(View(viewModel));
        }
示例#4
0
 public Task <InstanceModel> GetById(int id)
 {
     return(_dataAdapter.GetByIdAsync(id));
 }