public override void Restart()
        {
            this.Groups = new List <AutomationGroup>();
            this.TransactionManager.Reset();
            List <AutomationGroupEntry> automationGroupList = AutomationGroupEntry.LoadMany(this.MobilePaywallDatabase);
            List <AutomationEntry>      automationList      = AutomationEntry.Load(this.MobilePaywallDatabase, (from agl in automationGroupList where agl.IsActive select agl).ToList());
            List <KiwiclicksOfferEntry> offers = KiwiclicksOfferEntry.LoadMany(this.KiwiclickDataabse, automationList);

            this.Messages.Add(new AutomatizationToSkypeMessage("*Automation Groups* Loaded"));
            foreach (AutomationGroupEntry entry in automationGroupList)
            {
                if (!entry.IsActive)
                {
                    continue;
                }

                List <AutomationEntry>      groupEntryAutomations = (from ae in automationList where ae.AutomationGroupID == entry.ID select ae).ToList();
                List <KiwiclicksOfferEntry> groupOffers           = (from gea in groupEntryAutomations from o in offers where gea.ExternalOfferName.Equals(o.Name) select o).ToList();

                if (groupEntryAutomations == null || groupEntryAutomations.Count == 0)
                {
                    continue;
                }

                this.Groups.Add(new AutomationGroup(this, entry, groupEntryAutomations, groupOffers));
            }

            this.TransactionManager.Call();
        }
예제 #2
0
        public Automation(AutomationGroup parent, AutomationEntry entry)
        {
            this._group = parent;

            this._transaction       = new TransactionEntry();
            this._transaction.Count = 0;

            this._transaction.Created = DateTime.Now;
            this._entry = entry;
        }