Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4442 for trunk/sources


Ignore:
Timestamp:
09/20/10 05:16:33 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

Location:
trunk/sources/HeuristicLab.Services.OKB/3.3
Files:
3 edited

Legend:

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

    r4434 r4442  
    3232  [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    3333  public class AdminService : IAdminService {
     34    #region Platform Methods
     35    public Platform GetPlatform(long platformId) {
     36      using (OKBDataContext okb = new OKBDataContext()) {
     37        return okb.Platforms.FirstOrDefault(p => p.Id == platformId);
     38      }
     39    }
     40    public IEnumerable<Platform> GetPlatforms() {
     41      using (OKBDataContext okb = new OKBDataContext()) {
     42        return okb.Platforms.ToArray();
     43      }
     44    }
     45    public void StorePlatform(Platform platform) {
     46      using (OKBDataContext okb = new OKBDataContext()) {
     47        Platform original = okb.Platforms.FirstOrDefault(p => p.Id == platform.Id);
     48        if (original == null) {
     49          okb.Platforms.InsertOnSubmit(new Platform() {
     50            Name = platform.Name,
     51            Description = platform.Description
     52          });
     53        } else {
     54          original.Name = platform.Name;
     55          original.Description = platform.Description;
     56        }
     57        okb.SubmitChanges();
     58      }
     59    }
     60    public void DeletePlatform(long platformId) {
     61      using (OKBDataContext okb = new OKBDataContext()) {
     62        Platform platform = okb.Platforms.FirstOrDefault(p => p.Id == platformId);
     63        if (platform != null) {
     64          okb.Platforms.DeleteOnSubmit(platform);
     65          okb.SubmitChanges();
     66        }
     67      }
     68    }
     69    #endregion
     70
     71    #region AlgorithmClass Methods
    3472    public AlgorithmClass GetAlgorithmClass(long algorithmClassId) {
    3573      using (OKBDataContext okb = new OKBDataContext()) {
     
    66104      }
    67105    }
    68 
     106    #endregion
     107
     108    #region Algorithm Methods
    69109    public Algorithm GetAlgorithm(long algorithmId) {
    70110      using (OKBDataContext okb = new OKBDataContext()) {
     
    83123          okb.Algorithms.InsertOnSubmit(new Algorithm() {
    84124            Name = algorithm.Name,
    85             Description = algorithm.Description
     125            Description = algorithm.Description,
     126            PlatformId = algorithm.PlatformId,
     127            AlgorithmClassId = algorithm.AlgorithmClassId
    86128          });
    87129        } else {
    88130          original.Name = algorithm.Name;
    89131          original.Description = algorithm.Description;
     132          original.PlatformId = algorithm.PlatformId;
     133          original.AlgorithmClassId = algorithm.AlgorithmClassId;
    90134        }
    91135        okb.SubmitChanges();
     
    101145      }
    102146    }
    103 
    104     /// <summary>
    105     /// Gets all available platforms.
    106     /// </summary>
    107     /// <returns>A list of <see cref="Platform"/>s.</returns>
    108     public Platform[] GetPlatforms() {
    109       using (OKBDataContext okb = new OKBDataContext()) {
    110         return okb.Platforms.ToArray();
    111       }
    112     }
     147    #endregion
    113148
    114149    /// <summary>
  • trunk/sources/HeuristicLab.Services.OKB/3.3/Interfaces/IAdminService.cs

    r4426 r4442  
    3232  public interface IAdminService {
    3333    [OperationContract]
     34    Platform GetPlatform(long platformId);
     35    [OperationContract]
     36    IEnumerable<Platform> GetPlatforms();
     37    [OperationContract]
     38    void StorePlatform(Platform platform);
     39    [OperationContract]
     40    void DeletePlatform(long platformId);
     41
     42    [OperationContract]
    3443    AlgorithmClass GetAlgorithmClass(long algorithmClassId);
    3544    [OperationContract]
     
    5059
    5160
    52 
    53 
    54 
    55     /// <summary>
    56     /// Gets all available platforms.
    57     /// </summary>
    58     /// <returns>A list of <see cref="Platform"/>s.</returns>
    59     [OperationContract]
    60     Platform[] GetPlatforms();
    6161
    6262    /// <summary>
  • trunk/sources/HeuristicLab.Services.OKB/3.3/app.config

    r4407 r4442  
    3333      </mexHttpBinding>
    3434      <wsHttpBinding>
    35         <binding name="DefaultWsHttpBinding">
     35        <binding name="DefaultWsHttpBinding" maxReceivedMessageSize="2147483647">
    3636          <security mode="Message">
    3737            <message clientCredentialType="UserName" />
Note: See TracChangeset for help on using the changeset viewer.