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);
        }
 private void DeleteFilterButton_Click(object sender, EventArgs e)
 {
     if (ListFiltersDataGridView.SelectedRows.Count > 0)
     {
         EUCamlFilter filter = (EUCamlFilter)ListFiltersDataGridView.SelectedRows[0].Tag;
         CustomFilters.Remove(filter);
         BindGrid(CustomFilters);
     }
 }
Ejemplo n.º 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);
        }