Ejemplo n.º 1
0
        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 } };
            }
        }
Ejemplo n.º 2
0
        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 } };
            }
        }