public static bool GenerateRow(this ITableContent content, Authentication authentication) { var row = NewRandomRow(content, authentication); if (FillFields(row, authentication) == true) { if (RandomUtility.Within(25) == true) { row.SetTags(authentication, tags.Random()); } if (RandomUtility.Within(25) == true) { row.SetIsEnabled(authentication, RandomUtility.NextBoolean()); } try { content.EndNew(authentication, row); return(true); } catch { return(false); } } return(false); }
public static void CreateRow(this ITableContent content, Authentication authentication) { var table = content.Table; var parent = content.Parent; string relationID = null; if (parent != null && parent.Any() == true) { relationID = parent.Random().RelationID; } var row = content.AddNew(authentication, relationID); var types = table.GetService(typeof(ITypeCollection)) as ITypeCollection; foreach (var item in table.TableInfo.Columns) { if (item.AutoIncrement == false) { //row.SetField(authentication, item.Name, TypeContextExtensions.GetRandomValue(types, item)); } } if (RandomUtility.Within(25) == true) { row.SetTags(authentication, tags.Random()); } if (RandomUtility.Within(25) == true) { row.SetIsEnabled(authentication, RandomUtility.NextBoolean()); } content.EndNew(authentication, row); }
public static ITableRow AddRandomRow(this ITableContent content, Authentication authentication) { var row = content.AddNew(authentication, null); row.InitializeRandom(authentication); content.EndNew(authentication, row); return(row); }
public void EndNew() { var row = content.Dispatcher.Invoke(() => { content.BeginEdit(authentication); content.EnterEdit(authentication); return(content.AddNew(authentication, null)); }); content.EndNew(authentication, row); }
public void EndNew() { content.EndNew(authentication, row); }