Esempio n. 1
0
        public virtual void UpgradeData(string fromversion, string toversion)
        {
            if (fromversion == version_360)
            {
                From360To370();
                fromversion = version_370;
            }

            if (fromversion == version_380)
            {
                From380To390();
                fromversion = version_390;
            }

            if (fromversion == toversion)
            {
                var databaseversion = _versionRepository.Table.FirstOrDefault();
                if (databaseversion != null)
                {
                    databaseversion.DataBaseVersion = GrandVersion.CurrentVersion;
                    _versionRepository.Update(databaseversion);
                }
                else
                {
                    databaseversion = new GrandNodeVersion();
                    databaseversion.DataBaseVersion = GrandVersion.CurrentVersion;
                    _versionRepository.Insert(databaseversion);
                }
            }
        }
Esempio n. 2
0
        public virtual async Task UpgradeData(string fromversion, string toversion)
        {
            if (fromversion == version_400)
            {
                await From400To410();

                fromversion = version_410;
            }
            if (fromversion == version_410)
            {
                await From410To420();

                fromversion = version_420;
            }
            if (fromversion == version_420)
            {
                await From420To430();

                fromversion = version_430;
            }
            if (fromversion == version_430)
            {
                await From430To440();

                fromversion = version_440;
            }
            if (fromversion == version_440)
            {
                await From440To450();

                fromversion = version_450;
            }
            if (fromversion == version_450)
            {
                await From450To460();

                fromversion = version_460;
            }
            if (fromversion == toversion)
            {
                var databaseversion = _versionRepository.Table.FirstOrDefault();
                if (databaseversion != null)
                {
                    databaseversion.DataBaseVersion = GrandVersion.CurrentVersion;
                    await _versionRepository.UpdateAsync(databaseversion);
                }
                else
                {
                    databaseversion = new GrandNodeVersion {
                        DataBaseVersion = GrandVersion.CurrentVersion
                    };
                    await _versionRepository.InsertAsync(databaseversion);
                }
            }
        }
Esempio n. 3
0
 public virtual void UpgradeData(string fromversion, string toversion)
 {
     if (fromversion == version_400)
     {
         From400To410();
         fromversion = version_410;
     }
     if (fromversion == version_410)
     {
         From410To420();
         fromversion = version_420;
     }
     if (fromversion == version_420)
     {
         From420To430();
         fromversion = version_430;
     }
     if (fromversion == version_430)
     {
         From430To440();
         fromversion = version_440;
     }
     if (fromversion == version_440)
     {
         From440To450();
         fromversion = version_450;
     }
     if (fromversion == toversion)
     {
         var databaseversion = _versionRepository.Table.FirstOrDefault();
         if (databaseversion != null)
         {
             databaseversion.DataBaseVersion = GrandVersion.CurrentVersion;
             _versionRepository.Update(databaseversion);
         }
         else
         {
             databaseversion = new GrandNodeVersion();
             databaseversion.DataBaseVersion = GrandVersion.CurrentVersion;
             _versionRepository.Insert(databaseversion);
         }
     }
 }