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)); } }
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)); }
public void PutCalculationState(long periodId, long Id, CalculationStateDTO stateDto) { calculationService.ChangeCalculationState(periodId, Id, stateDto); }