Exemplo n.º 1
0
        public ActionResult PublishParty(PublishPartyInfo partyInfo)
        {
            string json;

            if (ModelState.IsValid)
            {
                try
                {
                    var partyId = PartyService.AddParty(partyInfo);

                    return(RedirectToAction("ViewParty", new { partyId = partyId, isCreate = true }));
                }
                catch (BasicSystemException ex)
                {
                    json = JsonHelper.GetJsonForFail(ex.ToLocalize());
                }
            }
            else
            {
                json = JsonHelper.GetJsonForFail(ModelValidationHelper.GetServSideValidErrorMsg(ModelState));
            }

            return(Content(json));
        }
Exemplo n.º 2
0
        public IActionResult AddParty(Party party)
        {
            PartyService.AddParty(party);

            return(Ok());
        }