Exemplo n.º 1
0
 public static void UpdateSave(PictureSaveData pictureSaveData)
 {
     try
     {
         SaveDb obj = DbTypeConvertor.FromPictureSaveData(pictureSaveData);
         DatabaseManager.db.UpdateTable(obj);
     }
     catch (Exception ex)
     {
         FMLogger.Log("upd saveData fail. " + ex.Message);
     }
 }
Exemplo n.º 2
0
 private static void InitialDbFill(PicturePack pack, List <PictureSaveData> saves)
 {
     for (int i = 0; i < pack.Pictures.Count; i++)
     {
         DatabaseManager.AddPicture(pack.Pictures[i]);
     }
     if (saves != null)
     {
         for (int j = 0; j < saves.Count; j++)
         {
             try
             {
                 SaveDb saveDb = DbTypeConvertor.FromPictureSaveData(saves[j]);
                 saveDb.TimeStamp -= (long)(j * 10000000);
                 DatabaseManager.db.Insert(saveDb);
             }
             catch (Exception ex)
             {
                 FMLogger.Log("error while inital save db fill. e:" + ex.Message);
             }
         }
     }
 }
Exemplo n.º 3
0
 public static void AddSave(PictureSaveData pictureSaveData)
 {
     try
     {
         SaveDb obj = DbTypeConvertor.FromPictureSaveData(pictureSaveData);
         DatabaseManager.db.Insert(obj);
         string    query = "SELECT * FROM PictureDb WHERE PicId=?";
         bool      flag;
         PictureDb pictureDb = DatabaseManager.db.QueryFirstRecord <PictureDb>(out flag, query, new object[]
         {
             pictureSaveData.Id
         });
         if (flag && pictureDb.HasSave == 0)
         {
             pictureDb.HasSave = 1;
             DatabaseManager.db.UpdateTable(pictureDb);
         }
     }
     catch (Exception ex)
     {
         FMLogger.Log("failed to add save. " + ex.Message);
         AnalyticsManager.DbTransactionError("saveDb", "AddSave: " + ex.Message);
     }
 }