//----------------------------------------------------------------------------------------------------------------------------------------------// public void Create() { creating = true; string groupName = groupManager.activeGroup.groupName; string projectRefName = "(" + groupName + ") " + projectName.text; DataRef.Groups(groupName).GetValueAsync().ContinueWith(async(task) => { await new WaitForUpdate(); DataSnapshot snapshot = task.Result; SetReference(groupName, "Project" + (snapshot.Child("Projects").ChildrenCount + 1).ToString(), projectRefName); }); DataRef.Projects(projectRefName).Child("ProjectName").SetValueAsync(projectName.text).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Projects(projectRefName).Child("ProjectDescription").SetValueAsync(projectDescription.text).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Projects(projectRefName).Child("FundingGoal").SetValueAsync((int.Parse(fund) * 100).ToString()).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Projects(projectRefName).Child("FundingAmount").SetValueAsync("0").ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Projects(projectRefName).Child("Group").SetValueAsync(groupName).ContinueWith(async(task) => { await new WaitForUpdate(); }); foreach (string tag in categoryTags) { DataRef.Projects(projectRefName).Child("Tags").Child("Categories").Child(tag).SetValueAsync(tag).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Filters("Category").Child(tag).Child(projectRefName).SetValueAsync(projectRefName).ContinueWith(async(task) => { await new WaitForUpdate(); }); } DataRef.Filters("Location").Child(locationText.text).Child(projectRefName).SetValueAsync(projectRefName).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Projects(projectRefName).Child("Tags").Child("Location").SetValueAsync(locationText.text).ContinueWith(async(task) => { await new WaitForUpdate(); ResetFields(); canvasScript.ToggleDoerSub(false); creating = false; groupManager.activeGroup.Populate(); }); activityManager.SetAlertNewProject(projectRefName, "Group_Default"); //activityManager.Resubscribe (); }
//----------------------------------------------------------------------------------------------------------------------------------------------// public void Create() { creating = true; string uid = auth.CurrentUser.UserId.ToString(); DataRef.CurrentUser().GetValueAsync().ContinueWith(async(task) => { await new WaitForUpdate(); DataSnapshot snapshot = task.Result; SetReference("Group" + (snapshot.Child("Groups").ChildrenCount + 1).ToString(), groupName.text); snap = snapshot; }); DataRef.Groups(groupName.text).Child("GroupName").SetValueAsync(groupName.text).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Groups(groupName.text).Child("GroupDescription").SetValueAsync(groupDescription.text).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Groups(groupName.text).Child("Contact").SetValueAsync(contact.text).ContinueWith(async(task) => { await new WaitForUpdate(); }); DataRef.Groups(groupName.text).Child("Administrator").SetValueAsync(uid).ContinueWith(async(task) => { await new WaitForUpdate(); ResetFields(); dataGetSet.GetGroupInfo(snap); canvas.ToggleDoerSub(false); creating = false; }); }