public SingleObjectModel WhatIfUpdateProjectDeadlines(string projectUID, string activityUID)
        {
            try {
                var project = Project.Parse(projectUID);

                Activity activity = project.GetActivity(activityUID);
                var      updater  = new ProcessUpdater(activity);

                WhatIfResult result = updater.OnUpdateDeadlines();
                return(new SingleObjectModel(this.Request, result.ToResponse(),
                                             typeof(WhatIfResult).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }
Exemplo n.º 2
0
        public SingleObjectModel WhatIfReactivated(string projectUID, string activityUID)
        {
            try {
                var project = Project.Parse(projectUID);

                Activity activity = project.GetActivity(activityUID);

                WhatIfResult result = ModelingServices.WhatIfReactivated(activity);

                return(new SingleObjectModel(this.Request, result.ToResponse(),
                                             typeof(WhatIfResult).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }
Exemplo n.º 3
0
        public SingleObjectModel WhatIfCreatedFromEvent(string projectUID,
                                                        [FromBody] object body)
        {
            try {
                base.RequireBody(body);

                var bodyAsJson = JsonObject.Parse(body);

                var activityModel = bodyAsJson.Get <Activity>("activityTemplateUID");
                var eventDate     = bodyAsJson.Get <DateTime>("eventDate", DateTime.Today);

                var project = Project.Parse(projectUID);

                WhatIfResult result = ModelingServices.WhatIfCreatedFromEvent(activityModel, project, eventDate);

                return(new SingleObjectModel(this.Request, result.ToResponse(),
                                             typeof(WhatIfResult).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }
Exemplo n.º 4
0
        public SingleObjectModel WhatIfCompleted(string projectUID, string activityUID,
                                                 [FromBody] object body)
        {
            try {
                base.RequireBody(body);
                var bodyAsJson = JsonObject.Parse(body);

                var project = Project.Parse(projectUID);

                Activity activity = project.GetActivity(activityUID);

                DateTime completedDate = bodyAsJson.Get <DateTime>("completedDate", DateTime.Today);

                WhatIfResult result = ModelingServices.WhatIfCompleted(activity, completedDate, true);

                return(new SingleObjectModel(this.Request, result.ToResponse(),
                                             typeof(WhatIfResult).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }