Пример #1
0
 public override string Invoke(string input)
 {
     CKeyNLR key = new CKeyNLR(input);
     WMEditContent ec = new WMEditContent(key, true, true, true, false, true, true, false, "Save and close", 500, 650);
     WorkflowInfo wi = Session.StartWorkflowMethod(ec);
     return null;
 }
Пример #2
0
    public override string Invoke(string input)
    {
        CKeyNLR key = new CKeyNLR(input);

        WMEditContent ec = new WMEditContent(key, true, true, true, false, true, true, false, Local.Text("Web.WAF.Edit.Webshop.DefaultSaveAndClose"), 500, 650);
        WorkflowInfo wi = Session.StartWorkflowMethod(ec);
        return null;
    }
Пример #3
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     WMCreateContent d = (WMCreateContent)invoker;
        // WFContext.Edit(d.CreatedContentKey);
     WMEditContent editWM = new WMEditContent(d.CreatedContentKey, true);
     //WFContext.RefreshDesktop();
     return new NextCall(editWM);
 }
Пример #4
0
 NextCall onCompleteCreate(WorkflowMethod invoker)
 {
     WMCreateContent diag = (WMCreateContent)invoker;
     _key = diag.CreatedContentKey;
     MemDefContentClass classDef = Engine.Definition.ContentClass[_key.ClassId];
     WMEditContent ec;
     ec = new WMEditContent(_key.CreateCKeyNLR(), true, true, false, false, true, false, false, "Create", 400, 700);
     return new NextCall(ec, onCompleteEdit, onCompleteCancel);
 }
Пример #5
0
 NextCall onCompleteCreate(WorkflowMethod invoker)
 {
     WMCreateContent diag = (WMCreateContent)invoker;
     _key = diag.CreatedContentKey;
     MemDefContentClass classDef = Engine.Definition.ContentClass[_key.ClassId];
     WMEditContent ec;
     if (classDef.AllParentsIncThis.Contains(SMS.ContentClassId)) {
         ec = new WMEditContent(_key.CreateCKeyNLR(), true, false, false, false, true, false, false, "Send SMS", 250, 500);
     } else {
         ec = new WMEditContent(_key.CreateCKeyNLR(), true, false, false, false, true, false, false, "Send MMS", 450, 760);
     }
     return new NextCall(ec, onCompleteEdit, onCompleteCancel);
 }
Пример #6
0
 public override string Invoke(string input)
 {
     CKeyNLR key = new CKeyNLR(input);
     MessageBase m = Session.GetContent<MessageBase>(key);
     m.Read = true;
     m.UpdateChanges();
     //Session.QueUIAction(new UIActionRefreshPage(Guid.Empty));
     WMEditContent ec = new WMEditContent(key, true);
     Session.StartWorkflowMethod(ec);
     return null;
 }
Пример #7
0
 void btnEditFilter_Click(object sender, EventArgs e)
 {
     WMEditContent c = new WMEditContent(filterKey, true, false, false, false, false, false, false, "Ok", 400, 700);
     WAFContext.StartWorkflowMethod(c);
     WFContext.RefreshWindow(WebDialogueContext.Exchange.Id);
 }
Пример #8
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     WMCreateContent d = (WMCreateContent)invoker;
     WMEditContent editWM = new WMEditContent(d.CreatedContentKey, true);
     return new NextCall(editWM);
 }
Пример #9
0
    NextCall onCompleteSettingsFromTask(WorkflowMethod invoker)
    {
        var form = invoker as WMContentForm;
        ScheduledTask task = Session.GetContent<ScheduledTask>(_taskNodeId);
        task.TypeName = form.Result.Get<ShortStringPropertyValue>("Typename").Value;
        task.FriendlyName = form.Result.Get<ShortStringPropertyValue>("FriendlyName").Value;

        //task.Enabled = form.Result.Get<CheckBoxPropertyValue>("Enabled").Value;
        task.IntervalUnit = (TaskShedulerIntervalUnit)int.Parse(form.Result.Get<ShortStringPropertyValue>("IntervalUnit").Value);
        task.StartAt = form.Result.Get<IntegerPropertyValue>("StartAt").Value;
        switch (form.Result.Get<ShortStringPropertyValue>("StartAtUnit").Value) {
            case "Seconds": task.StartAt = task.StartAt; break;
            case "Minutes": task.StartAt = task.StartAt * 60; break;
            case "Hours": task.StartAt = task.StartAt * 60 * 60; break;
            case "Days": task.StartAt = task.StartAt * 60 * 60 * 24; break;
            default: break;
        }
        task.UpdateChanges();
        if (_showSettingsButton && form.AnswerCustomIndex == 0) {// show settings
            Type t;
            IWorkflowMethodTaskWithSettings tw = null;
            try {
                t = Utils.GetType(task.TypeName);
            } catch {
                var diag = new WMQuestion(DialogueIcon.Warning, UIButtons.Ok, "Typename check:", "The typename was not found.");
                return new NextCall(diag, Invoke);
            }
            if (typeof(IWorkflowMethodTaskWithSettings).IsAssignableFrom(t)) {
                tw = Activator.CreateInstance(t) as IWorkflowMethodTaskWithSettings;
            } else {
                var diag = new WMQuestion(DialogueIcon.Warning, UIButtons.Ok, "Typename check:", "The typename must implement IWorkflowMethodTaskWithSettings to support settings.");
                return new NextCall(diag, Invoke);
            }
            tw.InitSettings(task);
            var diagSett = tw.CreateSettingsDialogue(task, Invoke);
            return diagSett;
        } else if ((_showSettingsButton && form.AnswerCustomIndex == 1) || (!_showSettingsButton && form.AnswerCustomIndex == 0)) { // test
            WorkflowMethod diag = null;
            if (task.TypeName.Length > 0) {
                Type t = null;
                try {
                    t = Utils.GetType(task.TypeName);
                } catch {
                    diag = new WMQuestion(DialogueIcon.Warning, UIButtons.Ok, "Typename check:", "The typename is unknown.");
                }
        #pragma warning disable 612, 618
                if (diag == null) {
                    if (typeof(WorkflowMethod).IsAssignableFrom(t) || typeof(System.Workflow.ComponentModel.Activity).IsAssignableFrom(t)) {
                        diag = new WMQuestion(DialogueIcon.Info, UIButtons.Ok, "Typename check:", "The typename is valid!");
                    } else {
                        diag = new WMQuestion(DialogueIcon.Warning, UIButtons.Ok, "Typename check:", "The type was found, but is does not inherit from: WorkflowMethod or Activity");
                    }
                }
        #pragma warning restore 612, 618
            } else {
                diag = new WMQuestion(DialogueIcon.Warning, UIButtons.Ok, "Typename check:", "Typename is empty. ");
            }
            return new NextCall(diag, Invoke);
        } else if ((_showSettingsButton && form.AnswerCustomIndex == 2) || (!_showSettingsButton && form.AnswerCustomIndex == 1)) { // internal
            WorkflowMethod diag = new WMEditContent(task.Key, true);
            return new NextCall(diag, Invoke);
        } else { // save & close
            WFContext.RefreshStartupRequest();
            return null;
        }
    }
Пример #10
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     if (_key == null) _key = new CKeyNLR(GetUnsecureInput<string>("selected"));
     var ec = new WMEditContent(_key, true, true, false, false, true, false, false, Local.Text("Web.WAF.Edit.Templates.MVCTemplatesSaveNClose"), 400, 700);
     return new NextCall(ec);
 }
Пример #11
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     WMEditContent d = new WMEditContent(Session.CompleteKeyC(this.GetSecureInput<int>()), true);
     return new NextCall(d);
 }
Пример #12
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     if (_key == null) _key = new CKeyNLR(GetUnsecureInput<string>("selected"));
     var ec = new WMEditContent(_key, true, true, false, false, true, false, false, "Save & Close", 400, 700);
     return new NextCall(ec);
 }