Exemplo n.º 1
0
        private bool SaveUserRunSubmission(SequencingPostModel postModel)
        {
            ValidateUserRunSubmission(postModel);

            if (ModelState.IsValid)
            {
                var userJob        = new UserJob();
                var userJobUserRun = new UserJobUserRun();

                AutoMapper.Mapper.Map(postModel, userJob);
                AutoMapper.Mapper.Map(postModel, userJobUserRun);
                userJob.UserJobUserRun  = userJobUserRun;
                userJob.User            = GetCurrentUser(true);
                userJob.RechargeAccount = postModel.RechargeAccount;

                AddPlates(postModel.PlateNames, userJob, userJob.JobType);

                _repositoryFactory.UserJobRepository.EnsurePersistent(userJob);

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool SaveUserRunSubmission(SequencingPostModel postModel)
        {
            ValidateUserRunSubmission(postModel);

            if (ModelState.IsValid)
            {
                var userJob = new UserJob();
                var userJobUserRun = new UserJobUserRun();

                AutoMapper.Mapper.Map(postModel, userJob);
                AutoMapper.Mapper.Map(postModel, userJobUserRun);
                userJob.UserJobUserRun = userJobUserRun;
                userJob.User = GetCurrentUser(true);
                userJob.RechargeAccount = postModel.RechargeAccount;

                AddPlates(postModel.PlateNames, userJob, userJob.JobType);

                _repositoryFactory.UserJobRepository.EnsurePersistent(userJob);

                return true;
            }

            return false;
        }