コード例 #1
0
        public Task <ServiceSuspend> UpdateJobStatuses(ServiceSuspend serviceSuspend) =>
        TryCatch(async() =>
        {
            ValidateServiceManagerParameters(serviceSuspend);

            return(await this.apiBroker.UpdateJobStatusesAsync(serviceSuspend));
        });
コード例 #2
0
        protected override async Task OnInitializedAsync()
        {
            result        = new ServiceSuspend();
            StartDate     = DateTime.Now;
            EndDate       = DateTime.Now;
            SelectMessage = "Select All";
            FontColor     = "green";
            await GetData();

            GetStatus();
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 public async Task <ServiceSuspend> RemoveDownTimesAsync(ServiceSuspend serviceSuspend) =>
 await this.PutContentAsync(RelativeServiceManagerUrl + "/RemoveJobTimes", serviceSuspend);
コード例 #5
0
 public async Task <ServiceSuspend> UpdateJobStatusesAsync(ServiceSuspend serviceSuspend) =>
 await this.PutContentAsync(RelativeServiceManagerUrl + "/UpdateJobStatuses", serviceSuspend);
コード例 #6
0
 public Task <ServiceSuspend> DeleteJobTimes(ServiceSuspend serviceSuspend) =>
 TryCatch(async() =>
 {
     return(await this.apiBroker.RemoveDownTimesAsync(serviceSuspend));
 });