Пример #1
0
        private IList <string> GetPostColumns(ISqlEntity data, SchemaTable schemaTable, bool isChange)
        {
            List <string> columns = null;

            if (data is AbstractEntity)
            {
                var entity = data as AbstractEntity;
                //修正not change column
                if (!entity.IsNew && !entity.IsDelete &&
                    entity.HasChangePropertys && isChange &&
                    schemaTable.Columns.Keys.Count > schemaTable.Keys.Length)
                {
                    columns = entity.DequeueChangePropertys().ToList();
                }
                else
                {
                    if (entity.HasChangePropertys)
                    {
                        entity.ResetChangePropertys();
                    }
                    columns = schemaTable.GetColumnNames();
                }
            }
            return(columns);
        }
Пример #2
0
 public void RollBack()
 {
     foreach (var kv in m_Entities)
     {
         ISqlEntity dumpedEntity = m_Serializer.Deserialize(kv.Value, kv.Key.GetType()) as ISqlEntity;
         foreach (var prop in kv.Key.GetType().GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance))
         {
             prop.SetValue(kv.Key, prop.GetValue(dumpedEntity));
         }
     }
 }
Пример #3
0
 public void DumpEntity(ISqlEntity entity)
 {
     if (m_Entities.ContainsKey(entity))
     {
         return;
     }
     else
     {
         m_Entities.Add(entity, m_Serializer.Serialize(entity));
     }
 }