Example #1
0
        protected static bool OnReturningInWork(Entity entity, IDictionary <string, object> inputValues, object context)
        {
            TaskEntity task = (TaskEntity)entity;

            string comment = (string)inputValues["Comment"];

            if (!string.IsNullOrWhiteSpace(comment))
            {
                task.AddComment(comment, TaskEntityStatus.InWork);
            }

            task.EndTime = DateTime.MinValue;

            return(true);
        }
Example #2
0
        protected static bool OnChangingToCanceled(Entity entity, IDictionary <string, object> inputValues, object context)
        {
            TaskEntity task = (TaskEntity)entity;

            string comment = (string)inputValues["Comment"];

            if (string.IsNullOrWhiteSpace(comment))
            {
                return(false);
            }

            task.AddComment(comment, TaskEntityStatus.Canceled);
            task.EndTime = DateTime.Now;

            return(true);
        }