Changeset 13690
- Timestamp:
- 03/11/16 15:26:56 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.OKB/3.3/RunCreation/RunCreationClient.cs
r13684 r13690 100 100 public IEnumerable<Solution> GetSolutions(long problemId) { 101 101 return CallRunCreationService(s => s.GetSolutions(problemId)); 102 } 103 104 public Solution GetSolution(long solutionId) { 105 return CallRunCreationService(s => s.GetSolution(solutionId)); 102 106 } 103 107 -
trunk/sources/HeuristicLab.Clients.OKB/3.3/RunCreation/ServiceClient/RunCreationServiceClient.cs
r13684 r13690 793 793 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.LongValue))] 794 794 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.TimeSpanValue))] 795 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.DoubleValue))] 796 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.PercentValue))] 797 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.FloatValue))] 795 798 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.IntValue))] 796 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.DoubleValue))]797 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.FloatValue))]798 799 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.StringValue))] 799 800 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.BinaryValue))] 800 [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.OKB.RunCreation.PercentValue))]801 801 public partial class Value : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged 802 802 { … … 949 949 [System.Diagnostics.DebuggerStepThroughAttribute()] 950 950 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 951 [System.Runtime.Serialization.DataContractAttribute(Name=" IntValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" +952 "aTransfer")] 953 public partial class IntValue : HeuristicLab.Clients.OKB.RunCreation.Value954 { 955 956 private intValueField;957 958 [System.Runtime.Serialization.DataMemberAttribute()] 959 public intValue951 [System.Runtime.Serialization.DataContractAttribute(Name="DoubleValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" + 952 "aTransfer")] 953 public partial class DoubleValue : HeuristicLab.Clients.OKB.RunCreation.Value 954 { 955 956 private double ValueField; 957 958 [System.Runtime.Serialization.DataMemberAttribute()] 959 public double Value 960 960 { 961 961 get … … 976 976 [System.Diagnostics.DebuggerStepThroughAttribute()] 977 977 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 978 [System.Runtime.Serialization.DataContractAttribute(Name=" DoubleValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" +979 "aTransfer")] 980 public partial class DoubleValue : HeuristicLab.Clients.OKB.RunCreation.Value978 [System.Runtime.Serialization.DataContractAttribute(Name="PercentValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" + 979 "aTransfer")] 980 public partial class PercentValue : HeuristicLab.Clients.OKB.RunCreation.Value 981 981 { 982 982 … … 1030 1030 [System.Diagnostics.DebuggerStepThroughAttribute()] 1031 1031 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1032 [System.Runtime.Serialization.DataContractAttribute(Name=" StringValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" +1033 "aTransfer")] 1034 public partial class StringValue : HeuristicLab.Clients.OKB.RunCreation.Value1035 { 1036 1037 private stringValueField;1038 1039 [System.Runtime.Serialization.DataMemberAttribute()] 1040 public stringValue1032 [System.Runtime.Serialization.DataContractAttribute(Name="IntValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" + 1033 "aTransfer")] 1034 public partial class IntValue : HeuristicLab.Clients.OKB.RunCreation.Value 1035 { 1036 1037 private int ValueField; 1038 1039 [System.Runtime.Serialization.DataMemberAttribute()] 1040 public int Value 1041 1041 { 1042 1042 get … … 1046 1046 set 1047 1047 { 1048 if (( object.ReferenceEquals(this.ValueField,value) != true))1048 if ((this.ValueField.Equals(value) != true)) 1049 1049 { 1050 1050 this.ValueField = value; … … 1057 1057 [System.Diagnostics.DebuggerStepThroughAttribute()] 1058 1058 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1059 [System.Runtime.Serialization.DataContractAttribute(Name=" BinaryValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" +1060 "aTransfer")] 1061 public partial class BinaryValue : HeuristicLab.Clients.OKB.RunCreation.Value1062 { 1063 1064 private byte[]ValueField;1065 1066 [System.Runtime.Serialization.DataMemberAttribute()] 1067 public byte[]Value1059 [System.Runtime.Serialization.DataContractAttribute(Name="StringValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" + 1060 "aTransfer")] 1061 public partial class StringValue : HeuristicLab.Clients.OKB.RunCreation.Value 1062 { 1063 1064 private string ValueField; 1065 1066 [System.Runtime.Serialization.DataMemberAttribute()] 1067 public string Value 1068 1068 { 1069 1069 get … … 1084 1084 [System.Diagnostics.DebuggerStepThroughAttribute()] 1085 1085 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 1086 [System.Runtime.Serialization.DataContractAttribute(Name=" PercentValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" +1087 "aTransfer")] 1088 public partial class PercentValue : HeuristicLab.Clients.OKB.RunCreation.Value1089 { 1090 1091 private doubleValueField;1092 1093 [System.Runtime.Serialization.DataMemberAttribute()] 1094 public doubleValue1086 [System.Runtime.Serialization.DataContractAttribute(Name="BinaryValue", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.RunCreation.Dat" + 1087 "aTransfer")] 1088 public partial class BinaryValue : HeuristicLab.Clients.OKB.RunCreation.Value 1089 { 1090 1091 private byte[] ValueField; 1092 1093 [System.Runtime.Serialization.DataMemberAttribute()] 1094 public byte[] Value 1095 1095 { 1096 1096 get … … 1100 1100 set 1101 1101 { 1102 if (( this.ValueField.Equals(value) != true))1102 if ((object.ReferenceEquals(this.ValueField, value) != true)) 1103 1103 { 1104 1104 this.ValueField = value; … … 1297 1297 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IRunCreationService/GetSolutions", ReplyAction="http://tempuri.org/IRunCreationService/GetSolutionsResponse")] 1298 1298 System.Threading.Tasks.Task<System.Collections.Generic.List<HeuristicLab.Clients.OKB.RunCreation.Solution>> GetSolutionsAsync(long problemId); 1299 1300 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IRunCreationService/GetSolution", ReplyAction="http://tempuri.org/IRunCreationService/GetSolutionResponse")] 1301 HeuristicLab.Clients.OKB.RunCreation.Solution GetSolution(long solutionId); 1302 1303 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IRunCreationService/GetSolution", ReplyAction="http://tempuri.org/IRunCreationService/GetSolutionResponse")] 1304 System.Threading.Tasks.Task<HeuristicLab.Clients.OKB.RunCreation.Solution> GetSolutionAsync(long solutionId); 1299 1305 1300 1306 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IRunCreationService/GetSolutionData", ReplyAction="http://tempuri.org/IRunCreationService/GetSolutionDataResponse")] … … 1433 1439 } 1434 1440 1441 public HeuristicLab.Clients.OKB.RunCreation.Solution GetSolution(long solutionId) 1442 { 1443 return base.Channel.GetSolution(solutionId); 1444 } 1445 1446 public System.Threading.Tasks.Task<HeuristicLab.Clients.OKB.RunCreation.Solution> GetSolutionAsync(long solutionId) 1447 { 1448 return base.Channel.GetSolutionAsync(solutionId); 1449 } 1450 1435 1451 public byte[] GetSolutionData(long solutionId) 1436 1452 { -
trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/IRunCreationService.cs
r13684 r13690 48 48 49 49 [OperationContract] 50 Solution GetSolution(long solutionId); 51 52 [OperationContract] 50 53 [FaultContract(typeof(MissingSolution))] 51 54 byte[] GetSolutionData(long solutionId); -
trunk/sources/HeuristicLab.Services.OKB/3.3/RunCreation/RunCreationService.cs
r13684 r13690 148 148 } 149 149 150 public DataTransfer.Solution GetSolution(long solutionId) { 151 roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser); 152 153 using (OKBDataContext okb = new OKBDataContext()) { 154 // TODO: In case of multi-objective problems one has to check whether it contains single- or multi-objective problems 155 var result = Convert.ToDto(okb.SingleObjectiveSolutions.SingleOrDefault(x => x.Id == solutionId)); 156 if (roleVerifier.IsInRole(OKBRoles.OKBAdministrator)) { 157 return result; 158 } else { 159 var problemUsers = okb.ProblemUsers.Where(x => x.ProblemId == result.ProblemId).ToList(); 160 if (problemUsers.Count == 0 || userManager.VerifyUser(userManager.CurrentUserId, problemUsers.Select(y => y.UserGroupId).ToList())) { 161 return result; 162 } else { 163 return null; 164 } 165 } 166 } 167 } 168 150 169 public byte[] GetSolutionData(long solutionId) { 151 170 roleVerifier.AuthenticateForAnyRole(OKBRoles.OKBAdministrator, OKBRoles.OKBUser);
Note: See TracChangeset
for help on using the changeset viewer.