public Task <ServiceSuspend> UpdateJobStatuses(ServiceSuspend serviceSuspend) => TryCatch(async() => { ValidateServiceManagerParameters(serviceSuspend); return(await this.apiBroker.UpdateJobStatusesAsync(serviceSuspend)); });
protected override async Task OnInitializedAsync() { result = new ServiceSuspend(); StartDate = DateTime.Now; EndDate = DateTime.Now; SelectMessage = "Select All"; FontColor = "green"; await GetData(); GetStatus(); }
private void ValidateServiceManagerParameters(ServiceSuspend serviceSuspend) { switch (serviceSuspend) { case null: throw new NullServiceSuspendException(); case { } when IsInvalid(serviceSuspend.JobId): throw new InvalidServiceSuspendException( parameterName: nameof(ServiceSuspend.JobId), parameterValue: serviceSuspend.JobId); case { } when IsInvalid(serviceSuspend.ServiceStart): throw new InvalidServiceSuspendException( parameterName: nameof(ServiceSuspend.ServiceStart), parameterValue: serviceSuspend.ServiceStart); case { } when IsInvalid(serviceSuspend.ServiceStop): throw new InvalidServiceSuspendException( parameterName: nameof(ServiceSuspend.ServiceStop), parameterValue: serviceSuspend.ServiceStop); } }
public async Task <ServiceSuspend> RemoveDownTimesAsync(ServiceSuspend serviceSuspend) => await this.PutContentAsync(RelativeServiceManagerUrl + "/RemoveJobTimes", serviceSuspend);
public async Task <ServiceSuspend> UpdateJobStatusesAsync(ServiceSuspend serviceSuspend) => await this.PutContentAsync(RelativeServiceManagerUrl + "/UpdateJobStatuses", serviceSuspend);
public Task <ServiceSuspend> DeleteJobTimes(ServiceSuspend serviceSuspend) => TryCatch(async() => { return(await this.apiBroker.RemoveDownTimesAsync(serviceSuspend)); });