Example #1
0
        /// <summary>
        /// Activity heavy lifting.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            //Get Argument Values
            string message = Message.Get(context) ?? String.Empty;
            string caption = Caption.Get(context) ?? String.Empty;
            XlateMessageBoxDefaultButtons defaultButtons = DefaultButtons.Get(context);

            //Heavy Lifting
            YesNoCancelDialogResult result = XlateMessageBox.YesNoCancel(message, caption, defaultButtons);

            DialogResult.Set(context, result);
        }
Example #2
0
        private void ShowDialog(object obj)
        {
            CodeActivityContext context = (CodeActivityContext)obj;

            //Get Argument Values
            string message = Message.Get(context) ?? String.Empty;
            string caption = Caption.Get(context) ?? String.Empty;
            XlateMessageBoxDefaultButtons defaultButtons = DefaultButtons.Get(context);

            bool result = XlateMessageBox.YesNoMessage(message, caption, defaultButtons);

            DialogResult.Set(context, result);
        }
        /// <summary>
        /// Activity heavy lifting.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            //Get Argument Values
            string message = Message.Get(context) ?? String.Empty;
            string caption = Caption.Get(context) ?? String.Empty;

            //Heavy Lifting
            YesNoDialogResult result = String.IsNullOrWhiteSpace(caption)
                ? XlateMessageBox.Warning(message)
                : XlateMessageBox.Warning(message, caption);

            DialogResult.Set(context, result);
        }
        protected override void Execute(NativeActivityContext context)
        {
            var taskCanceledWithComment = new TaskCanceledWithCommentEntry()
            {
                Id          = Guid.NewGuid(),
                Caption     = Caption.Get(context),
                QueueName   = QueueName.Get(context),
                TextComment = InputComment.Get(context),
            };

            var db = context.GetExtension <Db>();

            db.TaskCanceledWithComment.Add(taskCanceledWithComment);

            TaskCanceledId.Set(context, taskCanceledWithComment.Id);
        }
Example #5
0
        protected override void Execute(NativeActivityContext context)
        {
            var    cls      = Assembly.Load("WebApplication1").GetType("WebApplication1.Services.RequestAnswerServices");
            var    method   = cls.GetMethod("OpenWaitTest");
            string bookmark = Guid.NewGuid().ToString();

            method.Invoke(null, new object[] { context.WorkflowInstanceId, bookmark });
            context.CreateBookmark(bookmark);

            var approvalProcess = new ApprovalProcessEntry()
            {
                Id        = Guid.NewGuid(),
                Approve   = false,
                QueueName = "Ожидающие",
                Bookmark  = bookmark,
                WwfId     = context.WorkflowInstanceId,
                Info      = Caption.Get(context)
            };

            var db = context.GetExtension <Db>();

            db.ApprovalProcess.Add(approvalProcess);
        }
Example #6
0
        protected override void Execute(NativeActivityContext context)
        {
            var task = new UserTaskEntry()
            {
                Id             = Guid.NewGuid(),
                Caption        = Caption.Get(context),
                QueueName      = QueueName.Get(context),
                ViewName       = ViewName.Get(context),
                ViewInputModel = JsonConvert.SerializeObject(ViewInputModel.Get(context) ?? new object()
                                                             , Formatting.None
                                                             , new JsonSerializerSettings {
                    ContractResolver = new CamelCasePropertyNamesContractResolver(), DateFormatString = "dd.MM.yyyy"
                }),
                WWFId = context.WorkflowInstanceId
            };

            var db = context.GetExtension <Db>();

            db.UserTasks.Add(task);

            UserTaskId.Set(context, task.Id);

            context.ScheduleFunc(Wizard, task.Id, OnChildComplete);
        }
        /// <summary>
        /// Open the form and get a return value.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            MultiOptionMessageBoxStyleEnum style = (Style.Expression != null)
                                                       ? Style.Get(context)
                                                       : MultiOptionMessageBoxStyleEnum.DropDown;

            bool showCancelButton = (ShowCancelButton.Expression != null)
                                        ? ShowCancelButton.Get(context)
                                        : true;

            string windowTitle = String.IsNullOrEmpty(Caption.Get(context))
                   ? " "
                   : Caption.Get(context);

            List <string> items   = Items.Get(context);
            string        message = Message.Get(context);
            string        values  = String.Empty;

            foreach (string str in items)
            {
                if (items.IndexOf(str) != 0)
                {
                    values += ", ";
                }

                values += str;
            }

            Track("Items", values);

            DialogResult result;

            if (style == MultiOptionMessageBoxStyleEnum.DropDown)
            {
                var form = new MultiOptionDropDownForm
                {
                    Choices          = items,
                    Text             = windowTitle,
                    Message          = message,
                    ShowCancelButton = showCancelButton
                };

                result = form.ShowDialog();

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    SelectedIndex.Set(context, form.SelectedIndex);
                    SelectedText.Set(context, form.SelectedText);
                }
                DialogResult.Set(context, result);
            }
            else
            {
                var form = new MultiOptionButtonForm
                {
                    Choices          = items,
                    Text             = windowTitle,
                    Message          = message,
                    ShowCancelButton = showCancelButton
                };

                result = form.ShowDialog();

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    SelectedIndex.Set(context, form.SelectedIndex);
                    SelectedText.Set(context, form.SelectedText);
                }
                DialogResult.Set(context, result);
            }
        }