/// <summary> /// The target subject to search for results. This is the first query defined after the FROM clause. /// Setting this multiple times will simply use the last call. /// </summary> public virtual SqlGenerator ForTarget(ISqlSubject subject) { if (!_configuration.Contains(subject)) { throw new ArgumentException("Target subject must be part of given configuration."); } _target = subject; return(this); }
public MatrixConfiguration Matrix(ISqlSubject from, ISqlSubject to, string sql, string tooltip) { var node = _matrix[from][to]; node.Query = sql; node.ToolTip = tooltip; return(this); }
protected virtual void RemoveFromMatrix(ISqlSubject subject) { _matrix.Remove(subject); foreach (var s in _subjects) { if (_matrix[s].ContainsKey(subject)) { _matrix[s].Remove(subject); } } }
protected virtual void AddToMatrix(ISqlSubject subject) { _matrix.Add(subject, new Dictionary <ISqlSubject, MatrixNode>()); foreach (var s in _subjects) { _matrix[subject].Add(s, new MatrixNode()); if (!_matrix[s].ContainsKey(subject)) { _matrix[s].Add(subject, new MatrixNode()); } } }
private void Fill(DataTable table, ISqlSubject target) { foreach (var field in target) { table.Columns.Add(field.DisplayName); } int intCount = 0; DateTime dateCount = DateTime.Today; int stringCount = 0; for (var i = 0; i < 5; i++) { var row = table.NewRow(); foreach (var field in target) { if (field.DataType == typeof(int)) { row[field.DisplayName] = intCount++; } else if (field.DataType == typeof(DateTime)) { row[field.DisplayName] = (dateCount = dateCount.AddDays(1)); } else if (field.DataType == typeof(bool)) { row[field.DisplayName] = true; } else { row[field.DisplayName] = ((char)(65 + (stringCount++ % 26))).ToString(); } } table.Rows.Add(row); } }
public MatrixConfiguration Matrix(ISqlSubject from, ISqlSubject to, string sql) { return(Matrix(from, to, sql, null)); }
/// <summary> /// Fluently adds a new subject to the configuration. /// </summary> /// <param name="subject"></param> /// <returns></returns> public MatrixConfiguration Subject(ISqlSubject subject) { Add(subject); return(this); }
public MatrixNode this[ISqlSubject from, ISqlSubject to] { get { return(_matrix[from][to]); } }
public UniqueFieldPath(ISqlSubject root) { _field = root.IdField; _paths = new Dictionary <IRelationField, UniqueFieldPath>(); }