コード例 #1
0
        public IHttpActionResult Suspend(string id, SuspensionCode code, string notes = null)
        {
            var organization = GetModel(id, false);

            if (organization == null)
            {
                return(BadRequest());
            }

            organization.IsSuspended       = true;
            organization.SuspensionDate    = DateTime.Now;
            organization.SuspendedByUserId = ExceptionlessUser.Id;
            organization.SuspensionCode    = code;
            organization.SuspensionNotes   = notes;
            _repository.Save(organization);

            return(Ok());
        }
コード例 #2
0
        public async Task <IHttpActionResult> SuspendAsync(string id, SuspensionCode code, string notes = null)
        {
            var organization = await GetModelAsync(id, false);

            if (organization == null)
            {
                return(NotFound());
            }

            organization.IsSuspended       = true;
            organization.SuspensionDate    = SystemClock.UtcNow;
            organization.SuspendedByUserId = CurrentUser.Id;
            organization.SuspensionCode    = code;
            organization.SuspensionNotes   = notes;
            await _repository.SaveAsync(organization, o => o.Cache());

            return(Ok());
        }
コード例 #3
0
        public async Task <IHttpActionResult> SuspendAsync(string id, SuspensionCode code, string notes = null)
        {
            var organization = await GetModelAsync(id, false);

            if (organization == null)
            {
                return(NotFound());
            }

            organization.IsSuspended       = true;
            organization.SuspensionDate    = DateTime.UtcNow;
            organization.SuspendedByUserId = ExceptionlessUser.Id;
            organization.SuspensionCode    = code;
            organization.SuspensionNotes   = notes;
            await _repository.SaveAsync(organization, true);

            return(Ok());
        }