示例#1
0
        public ActionResult Add(AddPet addPet)
        {
            if (this.ModelState.IsValid)
            {
                int result = addPet.ExecuteNonQuery();
                return(Redirect($"/Providers/Pet/Profile/{addPet.Id}"));
            }

            return(View("FormPage", addPet));
        }
示例#2
0
        public ActionResult Add(AddPet addPet)
        {
            if (this.ModelState.IsValid)
            {
                int result = addPet.ExecuteNonQuery();
                return(new JsonResult()
                {
                    Data = new { Result = "Success", Url = $"/Providers/Owner/Profile/{addPet.OwnerId}" }
                });
            }

            this.AddAjaxPost("/Providers/Pet/Add", "Add Pet", x => x.OnSuccess = "paw.onAjaxFormSuccess");
            return(View("FormModal", addPet));
        }