Exemplo n.º 1
0
        public override void Process(object sender, ContentDataItemEventArgs e)
        {
            var views    = e.List.Views;
            var listPath = AppContext.NetDrive.MapPath(e.List.DefaultListPath);

            foreach (var view in views)
            {
                var viewTable = ContentViewDataHelper.GetViewTable(view);
                if (viewTable != null)
                {
                    ContentViewDataHelper.CreateDataRow(viewTable, view, e.DataItem);
                    viewTable.AcceptChanges();
                    ContentViewDataHelper.SaveViewTable(view, viewTable);
                }
            }
        }
Exemplo n.º 2
0
        public override void Process(object sender, ContentDataItemDeletedEventArgs e)
        {
            var views    = e.List.Views;
            var listPath = AppContext.NetDrive.MapPath(e.List.DefaultListPath);

            foreach (var view in views)
            {
                var viewTable = ContentViewDataHelper.GetViewTable(view);
                if (viewTable != null)
                {
                    var row = viewTable.Rows.Find(e.ItemID);
                    if (row != null)
                    {
                        //ContentViewDataHelper.Bind(view, row, e.DataItem);
                        viewTable.Rows.Remove(row);
                        viewTable.AcceptChanges();
                        ContentViewDataHelper.SaveViewTable(view, viewTable);
                    }
                }
            }
        }