public void DeleteAllRows(string sessionId, string docId, string fieldName) { var ds = new CaptureDocumentService(); // Get row count var tableValues = ds.GetDocumentTableFieldValue(sessionId, null, docId, new TableFieldIdentity() { //Id = tableId Name = fieldName }); var rowCount = tableValues.Tables[0].Rows.Count; // Populate a collection with all indexes var rowIndexes = new RowIndexCollection(); for (int row = 0; row < rowCount; row++) { rowIndexes.Add(new RowIndex() { Index = row }); } ds.DeleteTableFieldRow(sessionId, null, docId, fieldName, rowIndexes); }
public void ParseBufferTest() { const string data = "2011-01-24 06:29:46.687|Core.State.StartTime|Core|181188615|356.3245\r\n" + "2011-01-25 07:23:43.234|Core.State.StartTime|Core|181192343|3\r\n"; byte[] buffer = Encoding.UTF8.GetBytes(data); RowIndexCollection indexes = new RowIndexCollection(); LogFileParser parser = new LogFileParser(); parser.ParseBuffer(buffer, buffer.Length, indexes); List <LogRowIndex> rows = indexes.IndexesByItem["Core.State.StartTime"]; IEnumerator <LogRowIndex> rowIndexes = rows.GetEnumerator(); Assert.That(rowIndexes.MoveNext()); LogRowIndex idx = rowIndexes.Current; Assert.AreEqual(0, idx.RowStart); Assert.AreEqual(70, idx.RowLength); Assert.AreEqual(20, idx.NameLength); Assert.AreEqual(4, idx.UserLength); Assert.AreEqual(9, idx.CycleLength); Assert.That(rowIndexes.MoveNext()); idx = rowIndexes.Current; Assert.AreEqual(70, idx.RowStart); Assert.AreEqual(63, idx.RowLength); Assert.AreEqual(20, idx.NameLength); Assert.AreEqual(4, idx.UserLength); Assert.AreEqual(9, idx.CycleLength); Assert.That(!rowIndexes.MoveNext()); }