Exemplo n.º 1
0
 internal void EvaluateComputedDataObjects(SQLContext sqlContext)
 {
     //insert data in sql
     this.PersistBaseDataObjects(sqlContext);
     //set computed data tables
     this.SetComputedDataObjectContext(sqlContext);
 }
Exemplo n.º 2
0
 internal void SetComputedDataObjectContext(SQLContext context)
 {
     foreach (DataObject dob in this.dataObjectCollection.Where(d => d.IsComputed))
     {
         var table = context.GetDataTable(dob.ComputeQuery);
         SetDataContext(dob, table);
     }
 }
Exemplo n.º 3
0
        private void PersistBaseDataObjects(SQLContext sqlContext)
        {
            if (dataObjectCollection.Any(d => d.IsComputed) && !isBaseDataPersisted)
            {
                foreach (DataObject dob in this.dataContextDictionary.Keys.Where(d => !d.IsComputed))
                {
                    WriteLog(Constants.BlankLine);
                    var ctx = dataContextDictionary[dob];
                    if (!ctx.IsSQLTableCreated)
                    {
                        var sql1 = ctx.GetCreateTableQuery();
                        WriteLog(Environment.NewLine + sql1);
                        sqlContext.ExecuteNonQuery(sql1);
                        WriteLog($"SQLLite Table[{dob.Alias}] Created");
                    }

                    if (!ctx.IsDataInserted)
                    {
                        var sql2 = ctx.GetInsertQuery();
                        var idx  = sql2.NthIndexOf(Environment.NewLine, 3);
                        if (idx > -1)
                        {
                            WriteLog(Environment.NewLine + sql2.Substring(0, idx) + "...................");
                        }
                        else
                        {
                            WriteLog(sql2);
                        }

                        sqlContext.ExecuteNonQuery(sql2);
                        WriteLog("Data Persited");
                    }

                    isBaseDataPersisted = true;
                }
            }
        }
Exemplo n.º 4
0
 public DataObjectContext(DataObject dataObject, SQLContext Conn, Action <string> LogDelegate)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public PersistedDataObject(SQLContext context, DataObjectContext dataobjContext)
 {
 }