Changeset 6117
- Timestamp:
- 05/03/11 20:31:27 (14 years ago)
- Location:
- branches/WebApplication/MVC2/HLWebOKBAdminPlugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Controllers/AdminController.cs
r6050 r6117 39 39 AdminModel am = new AdminModel(); 40 40 Session["SelectedSubMenu"] = "AlgorithmClass"; 41 var algorithmClasses = am.AlgorithmClassGetAll(); 42 41 var algorithmClasses = am.AlgorithmClassGetAll(); 42 43 43 return View(algorithmClasses); 44 44 }//ActionResult AlgorithmClass -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Models/AdminModel.cs
r6050 r6117 11 11 private IList<AlgorithmClass> algorithmClassList; 12 12 13 13 14 public String SelectedSubMenu { get; set; } 14 15 public IList<AlgorithmClass> AlgorithmClassProp { get { return algorithmClassList; } set { ;} } 15 16 17 //***************************************Algorithm Class******************************************** 16 18 //get all algorithm classes 17 19 public IList<AlgorithmClass> AlgorithmClassGetAll() { … … 30 32 return algorithmClassList; 31 33 }//AlgorithmClassGetAll 32 34 35 public long AddAlgorithmClass(string name, string description) { 36 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 37 38 if (adminClient != null) { 39 AlgorithmClass ac = new AlgorithmClass(); 40 ac.Description = description; 41 ac.Name = name; 42 43 return adminClient.AddAlgorithmClass(ac); 44 } 45 46 return 0; 47 }//AddAlgorithmClass 48 49 public void DeleteAlgorithmClass(long id) { 50 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 51 52 if (adminClient != null){ 53 adminClient.DeleteAlgorithmClass(id); 54 } 55 }//DeleteAlgorithmClass 56 57 public void UpdateAlgorithmClass(long id, string name, string description) { 58 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 59 60 if (adminClient != null) { 61 AlgorithmClass ac = adminClient.GetAlgorithmClass(id); 62 63 if (ac != null) { 64 ac.Id = id; 65 ac.Name = name; 66 ac.Description = description; 67 68 adminClient.UpdateAlgorithmClass(ac); 69 } 70 } 71 }//UpdateAlgorithmClass 72 73 //***************************************Algorithms************************************************* 33 74 //get all algorithms 34 75 public IList<Algorithm> AlgorithmsGetAll() { … … 48 89 }//AlgorithmsGetAll 49 90 91 public long AddAlgorithm(string name, string description, string dataTypeName, string dataTypeTypeName) { 92 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 93 94 if (adminClient != null) { 95 Algorithm al = new Algorithm(); 96 al.DataTypeName = dataTypeName; 97 al.DataTypeTypeName = dataTypeTypeName; 98 al.Description = description; 99 al.Name = name; 100 101 return adminClient.AddAlgorithm(al); 102 } 103 104 return 0; 105 }//AddAlgorithm 106 107 public void DeleteAlgorithm(long id) { 108 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 109 110 if (adminClient != null) { 111 adminClient.DeleteAlgorithm(id); 112 } 113 }//DeleteAlgorithm 114 115 public void UpdateAlgorithm(long id, string name, string description, string dataTypeName, string dataTypeTypeName) { 116 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 117 118 if (adminClient != null) { 119 Algorithm al = adminClient.GetAlgorithm(id); 120 121 if (al != null){ 122 al.DataTypeName = dataTypeName; 123 al.DataTypeTypeName = dataTypeTypeName; 124 al.Description = description; 125 al.Name = name; 126 127 adminClient.UpdateAlgorithm(al); 128 } 129 } 130 }//UpdateAlgorithm 131 132 //***************************************Problem Class********************************************** 50 133 public IList<ProblemClass> ProblemClassGetAll() { 51 134 AdministrationServiceClient adminClient = Admin.GetClientFactory(); … … 63 146 }//ProblemClassGetAll 64 147 148 public long AddProblemClass(string name, string description) { 149 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 150 151 if (adminClient != null) { 152 ProblemClass pc = new ProblemClass(); 153 pc.Description = description; 154 pc.Name = name; 155 156 return adminClient.AddProblemClass(pc); 157 } 158 159 return 0; 160 }//AddProblemClass 161 162 public void DeleteProblemClass(long id) { 163 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 164 165 if (adminClient != null) { 166 adminClient.DeleteProblemClass(id); 167 } 168 }//DeleteProblemClass 169 170 public void UpdateProblemClass(long id, string name, string description) { 171 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 172 173 if (adminClient != null) { 174 ProblemClass pc = adminClient.GetProblemClass(id); 175 176 if (pc != null){ 177 pc.Id = id; 178 pc.Name = name; 179 pc.Description = description; 180 181 adminClient.UpdateProblemClass(pc); 182 } 183 } 184 }//UpdateProblemClass 185 186 //***************************************Problems*************************************************** 65 187 public IList<Problem> ProblemsGetAll() { 66 188 AdministrationServiceClient adminClient = Admin.GetClientFactory(); … … 78 200 return problemList; 79 201 }//ProblemsGetAll 202 203 public long AddProblem(string name, string description, string dataTypeName, string dataTypeTypeName) { 204 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 205 206 if (adminClient != null) { 207 Problem pr = new Problem(); 208 pr.DataTypeName = dataTypeName; 209 pr.DataTypeTypeName = dataTypeTypeName; 210 pr.Description = description; 211 pr.Name = name; 212 213 return adminClient.AddProblem(pr); 214 } 215 216 return 0; 217 }//AddProblem 218 219 public void DeleteProblem(long id) { 220 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 221 222 if (adminClient != null) { 223 adminClient.DeleteProblem(id); 224 } 225 }//DeleteProblem 226 227 public void UpdateProblem(long id, string name, string description, string dataTypeName, string dataTypeTypeName) { 228 AdministrationServiceClient adminClient = Admin.GetClientFactory(); 229 230 if (adminClient != null) { 231 Problem pr = adminClient.GetProblem(id); 232 233 if (pr != null) { 234 pr.DataTypeName = dataTypeName; 235 pr.DataTypeTypeName = dataTypeTypeName; 236 pr.Description = description; 237 pr.Name = name; 238 239 adminClient.UpdateProblem(pr); 240 } 241 } 242 }//UpdateProblem 80 243 } 81 244 } -
branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Views/Admin/Algorithm.aspx
r6050 r6117 16 16 17 17 <asp:ListBox ID="lbxAlgorithm" runat="server" DataSourceID="odsAlgorithm" 18 DataTextField="Name" DataValueField="Id" Width="240px" Height="350px" style="margin-top: 0px"></asp:ListBox> 18 DataTextField="Name" DataValueField="Id" Width="240px" Height="350px" 19 style="margin-top: 0px" AutoPostBack="True"></asp:ListBox> 19 20 <asp:ObjectDataSource ID="odsAlgorithm" runat="server" 20 21 SelectMethod="AlgorithmsGetAll"
Note: See TracChangeset
for help on using the changeset viewer.