Beispiel #1
0
 public void showImage(int imageId)
 {
     image = db.showImage(imageId);
     place = db.showPlace(image.PlaceId);
     fileGUI.imageChanger(place.Path + "/" + image.Url, "kure");
     imageTransition(image.Id);
 }
Beispiel #2
0
    public void enterDirectory(GameObject go)
    {
        if (go.name == item[0])
        {
            place = db.showPlace(id2[0]);
        }
        else if (go.name == item[1])
        {
            place = db.showPlace(id2[1]);
        }
        else if (go.name == item[2])
        {
            place = db.showPlace(id2[2]);
        }

        image = db.showImage(place.StartingImageId);
        load(image.Id);
    }
Beispiel #3
0
    public DBPlace showPlace(int place_id)
    {
        DBPlace result = new DBPlace();

        //conn = "URI=file:" + Application.dataPath + "/Resources/Elta.db";
        conn   = "URI=file:" + Application.persistentDataPath + "/Resources/Elta.db";
        dbconn = (IDbConnection) new SqliteConnection(conn);
        dbconn.Open();
        IDbCommand dbcmd = dbconn.CreateCommand();

        string sqlQuery = "SELECT * FROM place where id = " + place_id;

        dbcmd.CommandText = sqlQuery;
        IDataReader reader = dbcmd.ExecuteReader();

        while (reader.Read())
        {
            result.Id              = reader.GetInt32(0);
            result.Name            = reader.GetString(1);
            result.Path            = reader.GetString(2);
            result.Detail          = reader.GetString(3);
            result.Status          = reader.GetInt32(4);
            result.LocationId      = reader.GetInt32(5);
            result.StartingImageId = reader.GetInt32(6);
            result.CategoryId      = reader.GetInt32(7);
            result.ContactId       = reader.GetInt32(8);
        }
        reader.Close();
        reader = null;
        dbcmd.Dispose();
        dbcmd = null;
        dbconn.Close();
        dbconn = null;

        return(result);
    }
Beispiel #4
0
    public void reload(int i)
    {
        id = db.showPlacesId(i, 0);
        if (id.Count < 3)
        {
            switch (id.Count)
            {
            case 0:
                k  = db.firstLast(0);
                id = db.showPlacesId(k, 0);
                break;

            case 1:
                foreach (int a in db.showPlacesId(db.firstLast(0), 0))
                {
                    id.Add(a);
                }
                break;

            case 2:
                foreach (int a in db.showPlacesId(db.firstLast(0), 0))
                {
                    id.Add(a);
                }
                break;
            }
        }

        for (int j = 0; j < 3; j++)
        {
            place = db.showPlace(id[j]);
            image = db.showImage(place.StartingImageId);
            imageChanger(place.Path + "/" + image.Url, item[j]);
            id2[j] = id[j];
        }
    }