예제 #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);
            }
        }
예제 #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();
    }
예제 #3
0
        private void addimgbtn_Click(object sender, EventArgs e)
        {
            AddLevel instance = new AddLevel();

            instance.ShowDialog();
        }