Ejemplo n.º 1
0
        public ActionResult Execute()
        {
            IInteroperability myChanel = null;

            try
            {
                _LoggingService.Write("HomeController (Index) page access", true);
                Execution           myExecution = _ExecutionRepository.GetCurrent();
                List <Model.Action> myActions   = myExecution.Script.Action.ToList();
                myChanel = _WcfService.GetClientChanel();
                StringBuilder planeNameConcatenation = new StringBuilder();

                foreach (ExecutionPlane item in myExecution.ExecutionPlane)
                {
                    Plane current = _PlaneRepository.GetById(item.IdPlane);
                    planeNameConcatenation.Append(current.Name + ", ");
                    _FileService.Save(current.Name, current.FileContent);
                    myChanel.Process(_ActionRepository.GetAllAsWrapper(myActions, current.Name));
                    _PlaneRepository.Update(item.IdPlane, _FileService.ReadFromFile(current.Name));
                }

                ExecutionViewModel myModel = new ExecutionViewModel();
                myModel.LastExecutionPlanName = string.Format("{0} - {1}", myExecution.Script.Name, myExecution.Date.ToShortDateString());
                string myText = planeNameConcatenation.ToString();
                myText = myText.Remove(myText.Length - 2, 2);
                myModel.LastExecutionPlanText = string.Format("Script lanzado contra los siguientes planos: {0}", myText);

                return(RedirectToAction("Index", "Home"));
            }
            catch (Exception ex)
            {
                _LoggingService.WriteWithInner(ex, true, "ExecutionController(Execute) error: ");
                return(new HttpNotFoundResult());
            }
        }
Ejemplo n.º 2
0
 public void GetById()
 {
     Assert.IsTrue(myPlaneRepository.GetById("01a9e846-fc13-4f3e-ae61-3add48f2f8c6") != null);
 }