public EUCamlFilter(string fieldName, EUFieldTypes fieldType, EUCamlFilterTypes filterType, bool isOr, string filterValue)
 {
     FieldName   = fieldName;
     FieldType   = fieldType;
     FilterType  = filterType;
     FilterValue = filterValue;
 }
        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;
        }
        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);
        }
示例#4
0
        public static string GetCamlFilterTypeString(EUCamlFilterTypes filterType)
        {
            string camlString = String.Empty;

            switch (filterType)
            {
            case EUCamlFilterTypes.BeginsWith:
                camlString = "BeginsWith";
                break;

            case EUCamlFilterTypes.Contains:
                camlString = "Contains";
                break;

            case EUCamlFilterTypes.Equals:
                camlString = "Eq";
                break;

            case EUCamlFilterTypes.EqualsGreater:
                camlString = "Geq";
                break;

            case EUCamlFilterTypes.EqualsLesser:
                camlString = "Leq";
                break;

            case EUCamlFilterTypes.Greater:
                camlString = "Gt";
                break;

            case EUCamlFilterTypes.NotEqual:
                camlString = "Neq";
                break;
            }
            return(camlString);
        }