示例#1
0
 public void ChangeCalculationState(long periodId, long Id, CalculationStateDTO stateDto)
 {
     if (stateDto.State == Convert.ToInt32(CalculationState.Running.Value))
     {
         calcEngineService.RunCalculation(new CalculationId(Id));
     }
     else if (stateDto.State == Convert.ToInt32(CalculationState.Stopped.Value))
     {
         calcEngineService.StopCalculation(new CalculationId(Id));
     }
     else if (stateDto.State == Convert.ToInt32(CalculationState.Paused.Value))
     {
         calcEngineService.PauseCalculation(new CalculationId(Id));
     }
 }
示例#2
0
        public void ChangeCalculationState(Action <Exception> action, long periodId, long id, CalculationStateDTO calculationState)
        {
            var url = string.Format(baseAddress + makeApiAdress(periodId) + "/" + id + "/State");

            WebClientHelper.Put <CalculationStateDTO, CalculationStateDTO>(new Uri(url, UriKind.Absolute),
                                                                           (res, exp) => action(exp), calculationState,
                                                                           WebClientHelper.MessageFormat.Json, PMSClientConfig.CreateHeaderDic(userProvider.Token));
        }
示例#3
0
 public void PutCalculationState(long periodId, long Id, CalculationStateDTO stateDto)
 {
     calculationService.ChangeCalculationState(periodId, Id, stateDto);
 }