Exemple #1
0
        public static T Execute <T>(this T entity, ExecuteSymbol <T> symbol, params object[] args)
            where T : class, IEntity
        {
            var op = Find <IExecuteOperation>(entity.GetType(), symbol.Symbol).AssertEntity((Entity)(IEntity)entity);

            op.Execute(entity, args);
            return((T)(IEntity)entity);
        }
Exemple #2
0
        public static T ExecuteLite <T>(this Lite <T> lite, ExecuteSymbol <T> symbol, params object[] args)
            where T : class, IEntity
        {
            T   entity = lite.RetrieveAndForget();
            var op     = Find <IExecuteOperation>(lite.EntityType, symbol.Symbol).AssertLite();

            op.Execute(entity, args);
            return(entity);
        }
Exemple #3
0
 public static void ExecuteSubmit <T>(this NormalPage <T> container, ExecuteSymbol <T> symbol, bool consumeAlert = false)
     where T : Entity
 {
     container.OperationClick(symbol);
     if (consumeAlert)
     {
         container.Selenium.ConsumeAlert();
     }
     container.WaitLoadedAndId();
 }
Exemple #4
0
            public Execute(ExecuteSymbol <T> symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(ExecuteSymbol <T>), nameof(symbol));
                }

                this.Symbol = symbol;
                this.Lite   = true;
            }
Exemple #5
0
        public static void Execute <T>(this NormalWindowProxy <T> window, ExecuteSymbol <T> symbol, int?timeOut = null)
            where T : Entity
        {
            var entityId = window.EntityId;
            var button   = window.GetOperationButton(symbol.Symbol);

            window.Element.WaitDataContextChangedAfter(
                action: () => button.ButtonInvoke(),
                timeOut: timeOut ?? OperationTimeouts.ExecuteTimeout,
                actionDescription: () => "Executing {0} from {1}".FormatWith(symbol.Symbol, entityId));
        }
Exemple #6
0
        public static FluentInclude <T> WithSave <T>(this FluentInclude <T> fi, ExecuteSymbol <T> saveOperation)
            where T : Entity
        {
            new Graph <T> .Execute(saveOperation)
            {
                AllowsNew = true,
                Lite      = false,
                Execute   = (e, _) => { }
            }

            .Register();
            return(fi);
        }
Exemple #7
0
        public static FluentInclude <T> WithSave <T>(this FluentInclude <T> fi, ExecuteSymbol <T> saveOperation)
            where T : Entity
        {
            new Graph <T> .Execute(saveOperation)
            {
                CanBeNew      = true,
                CanBeModified = true,
                Execute       = (e, _) => { }
            }

            .Register();

            return(fi);
        }
Exemple #8
0
 public static FluentInclude <T> WithVirtualMList <T, L>(this FluentInclude <T> fi,
                                                         Expression <Func <T, MList <L> > > mListField,
                                                         Expression <Func <L, Lite <T>?> > backReference,
                                                         ExecuteSymbol <L> saveOperation,
                                                         DeleteSymbol <L> deleteOperation)
     where T : Entity
     where L : Entity
 {
     return(fi.WithVirtualMList(mListField, backReference,
                                onSave: saveOperation == null ? null : new Action <L, T>((line, e) =>
     {
         line.Execute(saveOperation);
     }),
                                onRemove: deleteOperation == null ? null : new Action <L, T>((line, e) =>
     {
         line.Delete(deleteOperation);
     })));
 }
        public static void Execute <T>(this IEntityButtonContainer <T> container, ExecuteSymbol <T> symbol, bool consumeAlert = false, bool checkValidationErrors = true)
            where T : Entity
        {
            container.WaitReload(() =>
            {
                container.OperationClick(symbol);
                if (consumeAlert)
                {
                    container.Element.GetDriver().CloseMessageModal(MessageModalButton.Yes);
                }
            });

            var vs = container as IValidationSummaryContainer;

            if (checkValidationErrors && vs != null)
            {
                AssertNoErrors(vs);
            }
        }
        public void ExecuteClick <T>(ExecuteSymbol <T> executeSymbol, bool consumeConfirmation = false, bool shouldDisapear = false)
            where T : Entity
        {
            var lites = ResultTable.SelectedEntities();

            Operation(executeSymbol).WaitVisible().Click();
            if (consumeConfirmation)
            {
                this.ResultTable.Selenium.ConsumeAlert();
            }

            if (shouldDisapear)
            {
                ResultTable.WaitNoVisible(lites);
            }
            else
            {
                ResultTable.WaitSuccess(lites);
            }
        }
Exemple #11
0
 public static FluentInclude <T> WithVirtualMList <T, L>(this FluentInclude <T> fi,
                                                         Func <T, MList <L> > getMList,
                                                         Expression <Func <L, Lite <T> > > getBackReference,
                                                         ExecuteSymbol <L> saveOperation,
                                                         DeleteSymbol <L> deleteOperation)
     where T : Entity
     where L : Entity
 {
     return(fi.WithVirtualMList(getMList, getBackReference,
                                onSave: saveOperation == null ? null : new Action <L, T>((line, e) =>
     {
         if (line.IsGraphModified)
         {
             line.Execute(saveOperation);
         }
     }),
                                onRemove: deleteOperation == null ? null : new Action <L, T>((line, e) =>
     {
         line.Delete(deleteOperation);
     })));
 }
Exemple #12
0
 public static void ExecuteAjax <T>(this IEntityButtonContainer <T> container, ExecuteSymbol <T> symbol, bool consumeAlert = false)
     where T : Entity
 {
     container.WaitReload(() =>
     {
         container.OperationClick(symbol);
         if (consumeAlert)
         {
             container.Selenium.ConsumeAlert();
         }
     });
 }
Exemple #13
0
 public static Graph <T> .Execute FindExecute <T>(ExecuteSymbol <T> symbol)
     where T : class, IEntity
 {
     return((Graph <T> .Execute)FindOperation(typeof(T), symbol.Symbol));
 }
Exemple #14
0
        public IDisposable Sync <T>(Dictionary <string, T> entityDic, IEnumerable <XElement> elements, IFromXmlContext ctx, ExecuteSymbol <T> saveOperation, DeleteSymbol <T> deleteOperation, Action <T, XElement> setXml)
            where T : Entity, IWorkflowObjectEntity, new()
        {
            var xmlDic = elements.ToDictionaryEx(a => a.Attribute("BpmnElementId") !.Value);

            Synchronizer.Synchronize(
                xmlDic,
                entityDic,
                createNew: (bpmnId, xml) =>
            {
                var entity           = new T();
                entity.BpmnElementId = xml.Attribute("BpmnElementId") !.Value;
                setXml(entity, xml);
                SaveOrMark <T>(entity, saveOperation, ctx);
                entityDic.Add(bpmnId, entity);
            },
Exemple #15
0
 public Execute(ExecuteSymbol <T> symbol)
     : base(symbol)
 {
     FromStates = new List <S>();
     ToStates   = new List <S>();
 }
Exemple #16
0
 public PackageExecuteAlgorithm(ExecuteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw new ArgumentNullException("operationKey");
 }
Exemple #17
0
 public static T ExecuteLite <T, B>(this Lite <T> lite, ExecuteSymbol <B> symbol, params object[] args)
     where T : class, IEntity, B
     where B : class, IEntity
 {
     return((T)(IEntity)Server.Return((IOperationServer s) => s.ExecuteOperationLite(lite, symbol.Symbol, args)));
 }
Exemple #18
0
 public static AutomationElement ExecuteCapture <T>(this NormalWindowProxy <T> window, ExecuteSymbol <T> symbol, int?timeOut = null)
     where T : Entity
 {
     return(window.OperationCapture(symbol.Symbol, timeOut));
 }
Exemple #19
0
 public Execute(ExecuteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw AutoInitAttribute.ArgumentNullException(typeof(ExecuteSymbol <T>), nameof(symbol));
 }