Exemplo n.º 1
0
 public static string UpdateAlert(EUSiteSetting siteSetting, string webUrl, EUAlert alert)
 {
     SobiensAlertsWS.AlertsWebService ws = new Sobiens.Office.SharePointOutlookConnector.SobiensAlertsWS.AlertsWebService();
     ws.Credentials = SharePointManager.GetCredential(siteSetting);
     ws.Url         = webUrl + "/_layouts/AlertsWebSebService.asmx";
     return(ws.UpdateAlert(alert.ID, alert.Title, alert.ListID, alert.AlertTime, alert.EventType, alert.AlertFrequency, alert.GetFilterXML()));
 }
Exemplo n.º 2
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EUAlert alert = (EUAlert)AlertsListView.SelectedItems[0].Tag;

            AlertManager.DeleteAlert(siteSetting, webUrl, alert.ID);
            AlertsListView.SelectedItems[0].Remove();
        }
 public void Initialize(EUSiteSetting _siteSetting, string _webUrl, string _listName, string _listID, EUAlert _alert)
 {
     siteSetting  = _siteSetting;
     webUrl       = _webUrl;
     listName     = _listName;
     listID       = _listID;
     CurrentAlert = _alert;
 }
 public void Initialize(string _webUrl, string _listName, string _listID, EUCamlFilters orGroup, EUAlert _alert, List <EUField> fields)
 {
     webUrl       = _webUrl;
     listName     = _listName;
     listID       = _listID;
     CurrentAlert = _alert;
     OrGroup      = orGroup;
     FieldsComboBox.Items.Clear();
     foreach (EUField field in fields)
     {
         FieldsComboBox.Items.Add(field);
     }
     FieldsComboBox.SelectedIndex = 0;
     FieldsComboBox.Focus();
 }
Exemplo n.º 5
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EUAlert alert = (EUAlert)AlertsListView.SelectedItems[0].Tag;

            if (alert.Title.IndexOf("[SPOutlookConnector]") == -1)
            {
                string alertLink = webUrl + "/_layouts/SubEdit.aspx?Alert={" + alert.ID + "}&List={" + alert.ListID + "}";
                Process.Start("IExplore.exe", alertLink);
            }
            else
            {
                AlertEditForm alertEditForm = new AlertEditForm();
                alertEditForm.Initialize(siteSetting, webUrl, alert.ListName, alert.ListID, alert);
                alertEditForm.ShowDialog();
            }
        }
Exemplo n.º 6
0
        private void NewButton_Click(object sender, EventArgs e)
        {
            AlertAddForm alertAddForm = new AlertAddForm();

            alertAddForm.Initialize(webUrl, siteSetting);
            alertAddForm.ShowDialog();
            if (alertAddForm.DialogResult == DialogResult.OK)
            {
                AlertEditForm alertEditForm = new AlertEditForm();
                EUAlert       alert         = new EUAlert();
                alert.Title  = alertAddForm.listName + " Alert";
                alert.ListID = alertAddForm.listID;
                alertEditForm.Initialize(siteSetting, webUrl, alertAddForm.listName, alertAddForm.listID, alert);
                alertEditForm.ShowDialog();
                if (alertEditForm.DialogResult == DialogResult.OK)
                {
                    Initialize();
                }
            }
        }
Exemplo n.º 7
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);
        }