コード例 #1
0
        private void AddFilterButton_Click(object sender, EventArgs e)
        {
            string       fieldName   = ((EUField)FieldsComboBox.SelectedItem).Name;
            string       filterValue = FilterValueTextBox.Text;
            EUCamlFilter filter      = new EUCamlFilter(fieldName, EUFieldTypes.Text, EUCamlFilterTypes.Equals, false, filterValue);

            CustomFilters.Add(filter);
            BindGrid(CustomFilters);
        }
コード例 #2
0
        private void SaveFilterButton_Click(object sender, EventArgs e)
        {
            string            fieldName     = ((EUField)FieldsComboBox.SelectedItem).Name;
            EUCamlFilterTypes operationType = (EUCamlFilterTypes)OperationComboBox.SelectedItem;
            string            value         = FilterValueTextBox.Text;

            if (OrGroup == null)
            {
                OrGroup = new EUCamlFilters();
                CurrentAlert.OrGroups.Add(OrGroup);
            }
            OrGroup.Add(new EUCamlFilter(fieldName, EUFieldTypes.Text, operationType, false, value));
            this.DialogResult = DialogResult.OK;
        }
コード例 #3
0
        public static EUAlert NodeToSobiensAlert(XmlNode node)
        {
            EUAlert alert = new EUAlert();

            alert.AlertFrequency   = node.Attributes["AlertFrequency"].Value;
            alert.AlertType        = node.Attributes["AlertType"].Value;
            alert.AlertTime        = node.Attributes["AlertTime"].Value;
            alert.AlwaysNotify     = node.Attributes["AlwaysNotify"].Value;
            alert.DynamicRecipient = node.Attributes["DynamicRecipient"].Value;
            alert.EventType        = node.Attributes["EventType"].Value;
            alert.EventTypeBitmask = node.Attributes["EventTypeBitmask"].Value;
            //alert.Filter = node.Attributes["Filter"].Value;
            alert.ID       = node.Attributes["ID"].Value;
            alert.ItemID   = node.Attributes["ItemID"].Value;
            alert.ListID   = node.Attributes["ListID"].Value;
            alert.ListName = node.Attributes["ListName"].Value;
            alert.ListUrl  = node.Attributes["ListUrl"].Value;
            alert.Status   = node.Attributes["Status"].Value;
            alert.Title    = node.Attributes["Title"].Value;
            alert.UserId   = node.Attributes["UserId"].Value;
            if (node["FilterXml"].ChildNodes.Count > 0)
            {
                XmlNode filterNode = node["FilterXml"].ChildNodes[0];
                foreach (XmlNode orNode in filterNode.ChildNodes)
                {
                    EUCamlFilters orGroup = new EUCamlFilters();
                    foreach (XmlNode andNode in orNode.ChildNodes)
                    {
                        var fieldName                = andNode["FieldName"].InnerText;
                        var operationType            = andNode["FilterType"].InnerText;
                        EUCamlFilterTypes filterType = (EUCamlFilterTypes)int.Parse(operationType);
                        var          value           = andNode["FilterValue"].InnerText;
                        EUCamlFilter filter          = new EUCamlFilter(fieldName, EUFieldTypes.Text, filterType, false, value);
                        orGroup.Add(filter);
                    }
                    alert.OrGroups.Add(orGroup);
                }
            }
            return(alert);
        }