Esempio n. 1
0
        public object Assess(AssessmentRequest assessmentRequest)
        {
            var record         = db.Load <Record>(assessmentRequest.Id);
            var assessmentInfo = new OpenDataAssessmentInfo
            {
                Completed       = true,
                CompletedByUser = new UserInfo
                {
                    DisplayName = user.User.DisplayName,
                    Email       = user.User.Email
                },
                CompletedOnUtc = Clock.NowUtc,
                InitialAssessmentWasDoneOnSpreadsheet = record.Publication?.OpenData?.Assessment?.InitialAssessmentWasDoneOnSpreadsheet == true
            };

            var updatedRecord = openDataPublishingRecordService.Assess(record, assessmentInfo);

            db.SaveChanges();

            return(updatedRecord);
        }
Esempio n. 2
0
        public object Assess(AssessmentRequest assessmentRequest)
        {
            var record         = db.Load <Record>(Helpers.AddCollection(assessmentRequest.Id));
            var assessmentInfo = new AssessmentInfo
            {
                Completed       = true,
                CompletedByUser = new UserInfo
                {
                    DisplayName = user.User.DisplayName,
                    Email       = user.User.Email
                },
                CompletedOnUtc = Clock.NowUtc,
                InitialAssessmentWasDoneOnSpreadsheet = record.Publication?.Assessment?.InitialAssessmentWasDoneOnSpreadsheet == true
            };

            var updatedRecord = recordPublishingService.Assess(record, assessmentInfo);

            db.SaveChanges();

            updatedRecord.Record = Helpers.RemoveCollectionFromId(updatedRecord.Record);
            return(updatedRecord);
        }