public async Task UpdateSynthesisProcess(GeneSynthesisProcessViewModel viewModel) { GeneSynthesisProcess entity = await GetCurrentGeneSynthesisProcess(); entity.DenaturationTempGeneAssembly = viewModel.DenaturationTempGeneAssembly; entity.DenaturationTimeGeneAssembly = viewModel.DenaturationTimeGeneAssembly; entity.AnnealingTempGeneAssembly = viewModel.AnnealingTempGeneAssembly; entity.AnnealingTimeGeneAssembly = viewModel.AnnealingTimeGeneAssembly; entity.ElongationTempGeneAssembly = viewModel.ElongationTempGeneAssembly; entity.ElongationTimeGeneAssembly = viewModel.ElongationTimeGeneAssembly; entity.DenaturationTempGeneAmplification = viewModel.DenaturationTempGeneAmplification; entity.DenaturationTimeGeneAmplification = viewModel.DenaturationTimeGeneAmplification; entity.AnnealingTempGeneAmplification = viewModel.AnnealingTempGeneAmplification; entity.AnnealingTimeGeneAmplification = viewModel.AnnealingTimeGeneAmplification; entity.ElongationTempGeneAmplification = viewModel.ElongationTempGeneAmplification; entity.ElongationTimeGeneAmplification = viewModel.ElongationTimeGeneAmplification; entity.NumberOfGeneAssemblyCycles = viewModel.NumberOfGeneAssemblyCycles; entity.NumberOfGeneAmplificationCycles = viewModel.NumberOfGeneAmplificationCycles; CalcGeneSynthesisProcessTotalTime(entity); unitOfWork.Commit(); }
public async Task <GeneSynthesisProcessViewModel> GetCurrentSynthesisProcess() { GeneSynthesisProcessViewModel geneSynthesisProcessViewModel; GeneSynthesisProcess currentGeneSynthesisProcess = await GetCurrentGeneSynthesisProcess(); if (currentGeneSynthesisProcess != null) { geneSynthesisProcessViewModel = new GeneSynthesisProcessViewModel() { Id = currentGeneSynthesisProcess.Id, GeneId = currentGeneSynthesisProcess.GeneId, Status = currentGeneSynthesisProcess.Status, TotalTime = currentGeneSynthesisProcess.TotalTime, SelectedGeneId = currentGeneSynthesisProcess.GeneId, DenaturationTempGeneAssembly = currentGeneSynthesisProcess.DenaturationTempGeneAssembly, DenaturationTimeGeneAssembly = currentGeneSynthesisProcess.DenaturationTimeGeneAssembly, AnnealingTempGeneAssembly = currentGeneSynthesisProcess.AnnealingTempGeneAssembly, AnnealingTimeGeneAssembly = currentGeneSynthesisProcess.AnnealingTimeGeneAssembly, ElongationTempGeneAssembly = currentGeneSynthesisProcess.ElongationTempGeneAssembly, ElongationTimeGeneAssembly = currentGeneSynthesisProcess.ElongationTimeGeneAssembly, DenaturationTempGeneAmplification = currentGeneSynthesisProcess.DenaturationTempGeneAmplification, DenaturationTimeGeneAmplification = currentGeneSynthesisProcess.DenaturationTimeGeneAmplification, AnnealingTempGeneAmplification = currentGeneSynthesisProcess.AnnealingTempGeneAmplification, AnnealingTimeGeneAmplification = currentGeneSynthesisProcess.AnnealingTimeGeneAmplification, ElongationTempGeneAmplification = currentGeneSynthesisProcess.ElongationTempGeneAmplification, ElongationTimeGeneAmplification = currentGeneSynthesisProcess.ElongationTimeGeneAmplification, NumberOfGeneAssemblyCycles = currentGeneSynthesisProcess.NumberOfGeneAssemblyCycles, NumberOfGeneAmplificationCycles = currentGeneSynthesisProcess.NumberOfGeneAmplificationCycles, }; } else { geneSynthesisProcessViewModel = new GeneSynthesisProcessViewModel() { Status = SynthesisProcessStatus.NotStarted, SelectedGeneId = "", }; } User currentUser = GetCurrentUser(); IEnumerable <Gene> allGenes = await unitOfWork.GetAll <Gene>() .Where(x => x.UserId == currentUser.Id) .ToListAsync(); geneSynthesisProcessViewModel.AllGenes = allGenes.Select(x => new ListItem() { Id = x.Id, Text = x.Name }); return(geneSynthesisProcessViewModel); }
public async Task <JsonResult> UpdateGeneSynthesisProcess(GeneSynthesisProcessViewModel synthesisProcessViewModel) { try { await geneSynthesizerService.UpdateSynthesisProcess(synthesisProcessViewModel); return(JsonSuccess(string.Empty)); } catch (Exception ex) { return(JsonError()); } }
public async Task <JsonResult> CreateGeneSynthesisProcess(string geneId) { try { await geneSynthesizerService.CreateGeneSynthesisProcess(geneId); GeneSynthesisProcessViewModel currentSynthesisProcessViewModel = await geneSynthesizerService.GetCurrentSynthesisProcess(); return(Json(currentSynthesisProcessViewModel, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(JsonError(ex.Message)); } }
public async Task <JsonResult> StopSynthesis(GeneSynthesisProcessViewModel synthesisProcessViewModel) { try { await geneSynthesizerService.StopSynthesis(); User currentUser = geneSynthesizerService.GetCurrentUser(); await signalHubContext.Clients.Group(currentUser.Id).addMessage( new SignalMessage { SignalType = SignalType.SuspendGeneSynthesisProcess }); return(JsonSuccess(string.Empty)); } catch (Exception ex) { return(JsonError()); } }
public async Task <ActionResult> Index() { GeneSynthesisProcessViewModel currentSynthesisProcessViewModel = await geneSynthesizerService.GetCurrentSynthesisProcess(); return(View(currentSynthesisProcessViewModel)); }