Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/16 16:01:23 (8 years ago)
Author:
abeham
Message:

#2588:

  • Added service method to add solutions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs

    r13682 r13683  
    2020#endregion
    2121
     22using HeuristicLab.Services.Access;
     23using HeuristicLab.Services.OKB.DataAccess;
    2224using System;
    2325using System.Collections.Generic;
     
    2527using System.Linq;
    2628using System.ServiceModel;
    27 using HeuristicLab.Services.Access;
    28 using HeuristicLab.Services.OKB.DataAccess;
    2929
    3030namespace HeuristicLab.Services.OKB.RunCreation {
     
    165165            return null;
    166166          }
     167        }
     168      }
     169    }
     170
     171    public void AddSolution(DataTransfer.Solution solution, byte[] data) {
     172      roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
     173
     174      using (OKBDataContext okb = new OKBDataContext()) {
     175        var soSolution = solution as DataTransfer.SingleObjectiveSolution;
     176        if (soSolution != null) {
     177          DataAccess.SingleObjectiveSolution entity = Convert.ToEntity(soSolution, data, okb);
     178          okb.SingleObjectiveSolutions.InsertOnSubmit(entity);
     179          okb.SubmitChanges();
    167180        }
    168181      }
Note: See TracChangeset for help on using the changeset viewer.