- Timestamp:
- 08/20/12 13:00:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OptimizationController.cs
r8384 r8506 33 33 34 34 public ActionResult ProblemParameters(string scenario) { 35 OptimizationScenario optScenario; 35 OptimizationScenario optScenario; 36 36 using (var cf = new ChannelFactory<IControllerService>(OptimizationController.DEFAULT_CONTROLLER_ENDPOINT)) { 37 37 var credentialBehaviour = cf.Endpoint.Behaviors.Find<ClientCredentials>(); … … 40 40 var controllerProxy = cf.CreateChannel(); 41 41 optScenario = controllerProxy.GetOptimizationScenarioByName(scenario); 42 Session["scenario"] = optScenario; 42 43 } 43 return View(optScenario );44 return View(optScenario.InputParameters); 44 45 } 45 46 46 47 [HttpPost] 47 public ActionResult ProblemParameters( OptimizationScenario scenario) {48 public ActionResult ProblemParameters(InputParameters parameters) { 48 49 if (ModelState.IsValid) { 49 // store it... maybe50 } 51 return View( scenario);50 return RedirectToAction("AlgorithmParameters", parameters); 51 } 52 return View(parameters); 52 53 } 53 54 55 public ActionResult AlgorithmParameters() { 56 return View((Session["scenario"] as OptimizationScenario).AlgorithmParameters); 57 } 58 59 [HttpPost] 60 public ActionResult AlgorithmParameters(AlgorithmParameters parameters) { 61 if (ModelState.IsValid) { 62 return RedirectToAction("ScheduleJob"); 63 } 64 return View(parameters); 65 } 66 67 public ActionResult ScheduleJob() { 68 return View(Session["scenario"]); 69 } 70 71 [HttpPost] 72 public ActionResult ScheduleJob(OptimizationScenario scenario) { 73 using (var cf = new ChannelFactory<IControllerService>(OptimizationController.DEFAULT_CONTROLLER_ENDPOINT)) { 74 var credentialBehaviour = cf.Endpoint.Behaviors.Find<ClientCredentials>(); 75 credentialBehaviour.UserName.UserName = Membership.GetUser().UserName; 76 credentialBehaviour.UserName.Password = Session["pw"] as string; 77 var controllerProxy = cf.CreateChannel(); 78 controllerProxy.ScheduleOptimizationScenario(Session["scenario"] as OptimizationScenario); 79 } 80 return RedirectToAction("Index"); 81 } 54 82 } 55 83 }
Note: See TracChangeset
for help on using the changeset viewer.