Example #1
0
    public static PictureSaveData GetSave(PictureData pd)
    {
        PictureSaveData result;

        try
        {
            SaveDb          s = DatabaseManager.db.Get <SaveDb>(pd.Id);
            PictureSaveData pictureSaveData = DbTypeConvertor.ToPictureSaveData(s);
            result = pictureSaveData;
        }
        catch
        {
            result = null;
        }
        return(result);
    }
Example #2
0
    public static List <PictureSaveData> GetSaves()
    {
        List <PictureSaveData> list = new List <PictureSaveData>();

        try
        {
            string        query = "SELECT * FROM SaveDb ORDER BY TimeStamp DESC";
            List <SaveDb> list2 = DatabaseManager.db.Query <SaveDb>(query, new object[0]);
            if (list2 != null)
            {
                for (int i = 0; i < list2.Count; i++)
                {
                    list.Add(DbTypeConvertor.ToPictureSaveData(list2[i]));
                }
            }
        }
        catch (Exception ex)
        {
            FMLogger.Log("failed to get saves. " + ex.Message);
            AnalyticsManager.DbTransactionError("saveDb", "GetSaves: " + ex.Message);
        }
        return(list);
    }