public static List <StorageType> ToList(BLL.StorageType v)
        {
            List <StorageType> list = new List <StorageType>();

            while (!v.EOF)
            {
                StorageType t = new StorageType();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("StorageTypeName"))
                {
                    t.StorageTypeName = v.StorageTypeName;
                }
                if (!v.IsColumnNull("IsSubTypeOf"))
                {
                    t.IsSubTypeOf = v.IsSubTypeOf;
                }
                if (!v.IsColumnNull("Prefix"))
                {
                    t.Prefix = v.Prefix;
                }
                //if(!v.IsColumnNull("IsDeleted"))
                //      t.IsDeleted = v.IsDeleted;
                //if(!v.IsColumnNull("UpdateTime"))
                //      t.UpdateTime = v.UpdateTime;

                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
        public static List <int> GetDeletedIDsAfter(long LastVersion)
        {
            BLL.StorageType v = new BLL.StorageType();
            // v.LoadDeletedIDs(LastVersion);
            List <int> list = new List <int>();

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
 public static void DeleteList(List <int> list)
 {
     BLL.StorageType bv = new BLL.StorageType();
     foreach (int v in list)
     {
         // try to load by primary key
         bv.LoadByPrimaryKey(v);
         // if the entry doesn't exist, create it
         if (bv.RowCount > 0)
         {
             bv.MarkAsDeleted();
             bv.Save();
         }
         // populate the contents of v on the to the database list
     }
 }
 public static List <StorageType> GetUpdatesAfter(long?lastVersion, DateTime?lastUpdateTime)
 {
     BLL.StorageType v = new BLL.StorageType();
     if (lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32(lastVersion.Value));
     }
     else if (lastUpdateTime.HasValue)
     {
         //v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }
     else
     {
         v.LoadAll();
     }
     return(ToList(v));
 }
        public static void SaveList(List <StorageType> list)
        {
            BLL.StorageType bv = new BLL.StorageType();
            foreach (StorageType v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
                if (v.ID.HasValue)
                {
                    bv.ID = v.ID.Value;
                }
                if (v.StorageTypeName != "" && v.StorageTypeName != null)
                {
                    bv.StorageTypeName = v.StorageTypeName;
                }
                if (v.IsSubTypeOf.HasValue)
                {
                    bv.IsSubTypeOf = v.IsSubTypeOf.Value;
                }
                if (v.Prefix != "" && v.Prefix != null)
                {
                    bv.Prefix = v.Prefix;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
 public static List <StorageType> GetAll()
 {
     BLL.StorageType v = new BLL.StorageType();
     v.LoadAll();
     return(ToList(v));
 }
        public static void SaveList(List<StorageType> list)
        {
            BLL.StorageType bv = new BLL.StorageType();
            foreach (StorageType v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
              if( v.ID.HasValue )
                   bv.ID = v.ID.Value;
              if( v.StorageTypeName != "" && v.StorageTypeName != null )
                   bv.StorageTypeName = v.StorageTypeName;
              if( v.IsSubTypeOf.HasValue )
                   bv.IsSubTypeOf = v.IsSubTypeOf.Value;
              if( v.Prefix != "" && v.Prefix != null )
                   bv.Prefix = v.Prefix;
              //if( v.IsDeleted.HasValue )
              //     bv.IsDeleted = v.IsDeleted.Value;
              //if( v.UpdateTime.HasValue )
              //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
 public static List<StorageType> GetUpdatesAfter(long? lastVersion,DateTime? lastUpdateTime)
 {
     BLL.StorageType v = new BLL.StorageType();
     if(lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32( lastVersion.Value ) );
     }else if(lastUpdateTime.HasValue)
     {
         //v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }else
     {
         v.LoadAll();
     }
     return ToList(v);
 }
 public static List<int> GetDeletedIDsAfter(long LastVersion)
 {
     BLL.StorageType v = new BLL.StorageType();
        // v.LoadDeletedIDs(LastVersion);
     List<int> list = new List<int>();
     while (!v.EOF)
     {
         list.Add((int)v.GetColumn("ID"));
         v.MoveNext();
     }
     return list;
 }
 public static List<StorageType> GetAll()
 {
     BLL.StorageType v = new BLL.StorageType();
     v.LoadAll();
     return ToList(v);
 }
        public static void DeleteList(List<int> list)
        {
            BLL.StorageType bv = new BLL.StorageType();
            foreach (int v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v);
                // if the entry doesn't exist, create it
                if (bv.RowCount > 0)
                {
                    bv.MarkAsDeleted();
                    bv.Save();
                }
                // populate the contents of v on the to the database list

            }
        }