Esempio n. 1
0
 public void StoreSearchFiles(SearchParametersDto param)
 {
     using (var db = new PerceptronDatabaseEntities())
     {
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 //Store Query Parameters
 public void StoreSearchParameters(SearchParametersDto param)
 {
     using (var db = new PerceptronDatabaseEntities())
     {
         db.SearchQueries.Add(param.SearchQuerry);
         db.SearchParameters.Add(param.SearchParameters);
         db.SearchFiles.AddRange(param.SearchFiles);
         //db.PtmFixedModifications.AddRange(param.FixedMods);
         //db.PtmVariableModifications.AddRange(param.VarMods);
         db.SaveChanges();
     }
 }
Esempio n. 3
0
 public int Set_Progress(string qid, int progress)
 {
     using (var db = new PerceptronDatabaseEntities())
     {
         var result = db.SearchQueries.SingleOrDefault(b => b.QueryId == qid);
         if (result != null)
         {
             result.Progress = progress.ToString();
             db.SaveChanges();
         }
     }
     return(1);
 }
Esempio n. 4
0
        //public string GetEmailFromUserId(string id)
        //{
        //    string email;
        //    using (var db = new PerceptronContext())
        //    {
        //        var query = from b in db.SearchQueryTable
        //            where b.UserId == id
        //            select b.Email;
        //        email = query.Any() ? query.First() : Constants.EmailNotFound;
        //    }
        //    return email;
        //}

        public string StoreResults(SearchResultsDto res, string fileName, int fileId)
        {
            string message = Constants.ResultsSotredSuccessfully; //Spelling mistake?#PROBLEM_DETECTED

            using (var db = new PerceptronDatabaseEntities())
            {
                var executionTime = GetExecutionTimeModel(res, fileName);
                db.ExecutionTimes.Add(executionTime);
                //db.SaveChanges();

                foreach (ProteinDto protein in res.FinalProt)
                {
                    var resId        = Guid.NewGuid();
                    var headerTag    = GetHeaderTag(protein.Header);
                    var searchResult = GetSearchResultModel(res.QueryId, fileId, headerTag, protein, resId);
                    db.SearchResults.Add(searchResult);
                    //db.SaveChanges();


                    if (protein.PtmParticulars == null)
                    {
                        continue;
                    }
                    foreach (var ptmSite in protein.PtmParticulars)
                    {
                        var resultPtmSites = GetResultPtmSitesModel(resId, ptmSite);
                        db.ResultPtmSites.Add(resultPtmSites);
                        //db.SaveChanges();
                    }

                    var resultInsilicoMatchLeft = GetResultInsilicoMatchLeftModel(resId, protein.InsilicoDetails.PeaklistMassLeft);
                    db.ResultInsilicoMatchLefts.Add(resultInsilicoMatchLeft);
                    //db.SaveChanges();

                    var resultInsilicoMatchRight = GetResultInsilicoMatchLeftModel(resId, protein.InsilicoDetails.PeaklistMassRight);
                    db.ResultInsilicoMatchLefts.Add(resultInsilicoMatchRight); //#PROBLEM_DETECTED??? Why this-->ResultInsilicoMatchLeftTable WHy not ResultInsilicoMatchRights
                    //db.SaveChanges();
                }

                db.SaveChanges();
            }
            return(message);
        }