Example #1
0
        public ActionResult InsertScheduledItem(String projectId, String itemId, String itemType, String scriptParameters, String when, String whenParameters)
        {
            Schedule schedule = _scheduleService.InsertSchedule(projectId, when, itemId, itemType);

            if (schedule != null)
            {
                List <Dictionary <String, String> > jsonScriptParameters = JsonConvert.DeserializeObject <List <Dictionary <String, String> > >(scriptParameters);

                foreach (Dictionary <String, String> scriptParameter in jsonScriptParameters)
                {
                    _scheduleService.InsertScheduleParameter(schedule.ExternalId, scriptParameter["name"], scriptParameter["value"]);
                }

                List <Dictionary <String, String> > jsonWhenParameters = JsonConvert.DeserializeObject <List <Dictionary <String, String> > >(whenParameters);

                foreach (Dictionary <String, String> whenParameter in jsonWhenParameters)
                {
                    _scheduleService.InsertScheduleDetail(schedule.ExternalId, whenParameter["name"], whenParameter["value"]);
                }

                return(Content(JSONHelper.BuildStatusMessage("success")));
            }
            else
            {
                return(Content(JSONHelper.BuildStatusMessage("failed", "Unable to create schedule")));
            }
        }
Example #2
0
        public ActionResult UpdateScriptSequences(String sequenceId, String scriptSequence)
        {
            String[] sequenceArray = JsonConvert.DeserializeObject <String[]>(scriptSequence);

            _sequenceService.UpdateScriptOrderInSequence(sequenceId, sequenceArray);

            return(Content(JSONHelper.BuildStatusMessage("success")));
        }
Example #3
0
        public ActionResult UpdateScheduledItem(String projectId, String scheduleId, String when, String whenParameters)
        {
            Boolean scheduleUpdated = _scheduleService.UpdateSchedule(scheduleId, when);

            if (scheduleUpdated)
            {
                List <Dictionary <String, String> > jsonWhenParameters = JsonConvert.DeserializeObject <List <Dictionary <String, String> > >(whenParameters);

                foreach (Dictionary <String, String> whenParameter in jsonWhenParameters)
                {
                    _scheduleService.InsertScheduleDetail(scheduleId, whenParameter["name"], whenParameter["value"]);
                }

                return(Content(JSONHelper.BuildStatusMessage("success")));
            }
            else
            {
                return(Content(JSONHelper.BuildStatusMessage("failed", "Unable to update schedule")));
            }
        }
        public ActionResult UpdatePackageCache(String projectId, String packageCacheId, Boolean cache)
        {
            _packageCacheService.UpdatePackageCache(packageCacheId, cache);

            return(Content(JSONHelper.BuildStatusMessage("success")));
        }
Example #5
0
        public ActionResult DeleteSequencedScript(String sequenceScriptId)
        {
            _sequenceScriptService.DeleteSequenceScript(sequenceScriptId);

            return(Content(JSONHelper.BuildStatusMessage("success")));
        }