CAESGenome.Services.BarcodeService.AcceptQualityControl C# (CSharp) Method

AcceptQualityControl() public method

public AcceptQualityControl ( IRepositoryFactory repositoryFactory, Barcode barcode ) : void
repositoryFactory IRepositoryFactory
barcode Barcode
return void
        public void AcceptQualityControl(IRepositoryFactory repositoryFactory, Barcode barcode)
        {
            barcode.Done = true;
            barcode.AllowDownload = true;

            var plate = barcode.UserJobPlate;
            plate.Completed = true;
            plate.DateTimeCompleted = DateTime.Now;
            repositoryFactory.UserJobPlateRepository.EnsurePersistent(plate);

            var userJob = barcode.UserJobPlate.UserJob;
            userJob.LastUpdate = DateTime.Now;
            if (userJob.UserJobPlates.All(a => a.Completed))
            {
                userJob.IsOpen = false;
                userJob.LastUpdate = DateTime.Now;
            }

            repositoryFactory.UserJobRepository.EnsurePersistent(userJob);

            // 2013-04-09 by kjt: Added client email notification:
            EmailService.SendMessage(userJob);
        }

Usage Example

Example #1
0
        /* 2013-01-17 by kjt: This method should "shortcut" the
         * need to perform validation on the barcode provided.
         * This in intended to be called for non-sequencing jobs,
         * so they can be downloaded immediately after moving into "raw"
         * directory.
         */
        public void SkipValidationAndAllowForDownload(Barcode barcode)
        {
            IBarcodeService barcodeService = new BarcodeService();

            //// This sets the barcode files' "Validated" bit so they won't
            //// show up as needing PhRed validation:
            //foreach (var bcf in barcode.BarcodeFiles)
            //{
            //    bcf.Validated = true;
            //    _repositoryFactory.BarcodeFileRepository.EnsurePersistent(bcf);
            //}

            //// This sets DateTimeValidated because it's doubling as DateTimeCompleted
            //// on the downloads page at it would otherwise remain blank because
            //// validation is being bypassed for non-sequencing jobs:
            //barcode.DateTimeValidated = DateTime.Now;
            //_repositoryFactory.BarcodeRepository.EnsurePersistent(barcode);

            // This sets the remainder of the fields that allow downloading,
            // such as "Done", and "AllowDownload", etc, plus some basic
            // housekeeping and setting of fields for sub-objects:
            barcodeService.AcceptQualityControl(_repositoryFactory, barcode);
        }
All Usage Examples Of CAESGenome.Services.BarcodeService::AcceptQualityControl