private void btnCreateRule_Click(object sender, RoutedEventArgs e)
        {
            Rule          newRule = rcv.GetRule();
            CommandResult comres;

            if (editedRule == null)
            {
                comres = _br.CreateObject <Rule>(newRule);
            }
            else
            {
                comres = _br.ModifyObject <Rule>(newRule, editedRule.Id);
            }


            if (comres.Success)
            {
                log.Info(editedRule == null ? $"Created new rule : {newRule.name}" : $"Updated rule : {newRule.name}");
                if (((MessageCollection)comres.resultobject)[0] is CreationSuccess)
                {
                    id = ((CreationSuccess)((MessageCollection)comres.resultobject)[0]).id;
                }
                else
                {
                    id = ((Success)((MessageCollection)comres.resultobject)[0]).id;
                }

                DialogResult = true;
                Close();
            }
            else
            {
                _br.ShowErrorMessages();
            }
        }
        private void btnCreateRule_Click(object sender, RoutedEventArgs e)
        {
            Rule newRule = rcv.GetRule();

            newRule.owner          = null;
            newRule.created        = null;
            newRule.timestriggered = null;
            newRule.lasttriggered  = null;
            string cr = null;

            cr = editedRule == null?_br.CreateRule(newRule) : _br.ModifyRule(editedRule.Id, newRule);

            if (cr != "")
            {
                log.Info(editedRule == null ? $"Created new rule : {newRule.name}" : $"Updated rule : {newRule.name}");
                DialogResult = true;
                _id          = cr;
                Close();
            }
            else
            {
                _br.ShowErrorMessages();
            }
        }