コード例 #1
0
ファイル: CommonController.cs プロジェクト: r3plica/Boomerang
        public JsonResult SaveAddress(Address Address)
        {
            try
            {
                Address.Save();

                return new JsonResult { Data = new { success = true, id = Address.Id } };
            }
            catch (Exception ex)
            {
                return new JsonResult { Data = new { success = false, error = ex.Message } };
            }
        }
コード例 #2
0
ファイル: CommonController.cs プロジェクト: r3plica/Boomerang
        public JsonResult DeleteAddress(int id)
        {
            try
            {
                Address address = new Address(id);
                address.Delete();

                return new JsonResult { Data = new { success = true } }; // Return nothing as there are no errors
            }
            catch (Exception ex)
            {
                return new JsonResult { Data = new { success = false, error = ex.Message } };
            }
        }