示例#1
0
        public async Task <ActionResult> SaveTeamNotes(string teamId, [Bind(Include = "Id, Content")] TeamNote teamNote)
        {
            PlayViewModel model = new PlayViewModel();

            teamNote.TeamId = teamId;
            if (!string.IsNullOrEmpty(teamNote.Id))
            {
                if (await model.CreateTeamNotes(teamNote))
                {
                    TempData["ErrorMessage"] = "Note added to team";
                }
                else
                {
                    TempData["ErrorMessage"] = "There is some problem in adding note to team";
                }
            }
            else
            {
                if (await model.CreateTeamNotes(teamNote))
                {
                    TempData["ErrorMessage"] = "Note updated to team";
                }
                else
                {
                    TempData["ErrorMessage"] = "There is some problem in updating note to team";
                }
            }

            ActionResult result;

            result = RedirectToAction("Install", new { teamId = teamId });
            return(await Task.FromResult(result));
        }
 public async Task <bool> CreateTeamNotes(TeamNote teamNote)
 {
     return(await new RestHelper().Post($"api/TeamNotes/CreateTeamNotes", teamNote));
 }