public JsonResult DeleteOwner(int Id, int DogId)
 {
     Business.User.Delete(Id);
     Dogs d = new Dogs(DogId);
     d.OwnerID = -1;
     d.Save();
     return Json(new
     {
         Status = 0
     });
 }
        public JsonResult SaveDog(DogDetailsDto dogDetails)
        {
            try
            {
                TrackUser("SaveDog", Newtonsoft.Json.JsonConvert.SerializeObject(dogDetails));
            }
            catch
            {
            }
            int dogid = dogDetails.DogId;
            Dogs dogs = new Dogs(dogid);
            dogs.HandlerID = (dogDetails.UserId > 0 ? dogDetails.UserId : CurrentUser.ID);
            dogs.KCName = dogDetails.KCName;
            dogs.KCNumber = dogDetails.KCNumber;
            dogs.PetName = dogDetails.PetName;
            dogs.Grade = dogDetails.Grade;
            dogs.Height = dogDetails.Height;
            dogs.DoB = dogDetails.DoB;
            dogs.Sex = dogDetails.sex;
            dogs.DogIcon = dogDetails.DogIcon;
            dogs.DogColour = dogDetails.DogColour;
            dogs.Breed = dogDetails.Breed;
            dogs.BreedType = dogDetails.BreedType + dogDetails.CrossBreed + dogDetails.GunDog;
            dogs.Rescue = dogDetails.Rescue;
            dogs.AltHandlerID = dogDetails.AltHandlerId;
            dogs.Save();
            AppException.LogEvent(String.Format("SaveDog: UserID={0}, DogId={1}", dogDetails.UserId, dogid));

            return Json(new
            {
                Status = 0,
                DogID = dogs.ID
            });
        }
        public JsonResult AddOwner(OwnerModel owner)
        {
            User u = new User(owner.Id);
            u.Name = owner.Name;
            u.FirstName = "";
            u.LastName = "";
            u.EmailAddress = "";
            u.Password = "";
            u.Address = owner.Address;
            u.Postcode = owner.Postcode;
            u.HomePhone = owner.HomePhone;
            u.Update();

            if (u.UserID > 0)
            {
                Dogs d = new Dogs(owner.DogId);
                d.OwnerID = u.UserID;
                d.Save();
            }

            return Json(new
            {
                Status = 0,
                UserId = u.UserID
            });
        }