コード例 #1
0
ファイル: AdminController.cs プロジェクト: riha/spin2win
        public JsonResult SavePlayer(Player player)
        {
            string playerId;
            try
            {
                var context = new CloudTableContext();
                playerId = context.SavePlayer((User)HttpContext.User.Identity, player);
            }
            catch (Exception exception)
            {
                //TODO:logging of exception!
                return Json(new { Success = false, ErrorMessage = exception.Message });
            }

            return Json(new { Success = true, Id = playerId });
        }
コード例 #2
0
ファイル: AdminController.cs プロジェクト: riha/spin2win
        public JsonResult DeletePlayer(Player player)
        {
            try
            {
                var context = new CloudTableContext();
                context.DeletePlayer((User)HttpContext.User.Identity, player);
            }
            catch (Exception exception)
            {
                //TODO:logging of exception!
                //return new HttpResponseMessage(HttpStatusCode.InternalServerError);
                return Json(new { Success = false, ErrorMessage = exception.Message });
            }

            return Json(new { Success = true });
        }