예제 #1
0
        private void CreateNewRule()
        {
            List <AdminService.Trigger> triggers = new List <AdminService.Trigger>();

            foreach (var i in Constructor.Triggers)
            {
                if (i.baseTrigger != null)
                {
                    triggers.Add(i.baseTrigger);
                }
            }

            Rule created = new Rule()
            {
                Name      = Constructor.Name,
                Triggers  = triggers,
                DayFrom   = Constructor.SelectedDayFrom,
                DayTill   = Constructor.SelectedDayTill,
                TimeFrom  = Constructor.TimeFrom,
                TimeTill  = Constructor.TimeTill,
                Link      = Constructor.SelectedLink,
                Source    = Constructor.SelectedSource,
                Action    = Constructor.SelectedAction,
                Parameter = Constructor.ActionParam
            };

            BusinessRules.Add(new BusinessRule(created));
            client.AddBusinessRule(created);

            Constructor.ClearContents();
        }