Exemplo n.º 1
0
        private void Save()
        {
            Group group = new Group();

            group.key  = _keyStringFormGroup.Value;
            group.name = _nameStringFormGroup.Value;

            if (OldGroup != null && OldGroup.key != group.key)
            {
                GroupFileDao.Delete(DataScope, OldGroup.key);
                group.rules = OldGroup.rules;
            }

            GroupFileDao.Save(_scopeEnumFormGroup.Value, group);

            Close();
        }
Exemplo n.º 2
0
        private void Save()
        {
            if (OldRule != null)
            {
                GroupFileDao.Delete(DataScope, OldGroup.key, OldRule.key);
            }

            Rule rule = new Rule
            {
                key         = _keyStringFormGroup.Value,
                description = _descriptionStringFormGroup.Value,
                cypherQuery = _cypherQueryTextAreaFormGroup.Value,
                type        = _ruleTypeFormGroup.Value
            };

            string    groupName = _groupDropdownFormGroup.Value;
            DataScope dataScope = RuleDao.Instance.GetDataScopeByGroupName(groupName);

            GroupFileDao.Save(dataScope, groupName, rule);

            Close();
        }