Ejemplo n.º 1
0
        public bool CreateLevel(AddLevel model)
        {
            var entity = new LevelTable()
            {
                XP = model.XP
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.LevelTable.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Ejemplo n.º 2
0
    //working
    public IEnumerator addLevel(string name, string description, string weather, int maxScore, string json)
    {
        clearList();
        Debug.Log("Adding level to user " + AccountManager.idCurrentUser + "...");
        string sailsUrl = "https://immense-lake-57494.herokuapp.com/levels";

        AddLevel body = new AddLevel();

        body.name           = name;
        body.json           = json;
        body.createdAt      = null;
        body.updatedAt      = null;
        body.description    = description;
        body.weather_savior = weather;
        body.maxScore       = maxScore;
        body.idUser         = AccountManager.idCurrentUser;

        string bodyJson = JsonUtility.ToJson(body);

        yield return(StartCoroutine(_webRequester.PostComplete(sailsUrl, bodyJson)));

        Debug.Log("Level Added");
        UpdateList();
    }
Ejemplo n.º 3
0
        private void addimgbtn_Click(object sender, EventArgs e)
        {
            AddLevel instance = new AddLevel();

            instance.ShowDialog();
        }