Ejemplo n.º 1
0
        public IEnumerable<Pet> Get()
        {
            List<Pet> pets = new List<Pet>();

            //get pets from db
            using (SqlConnection connection = new SqlConnection(this.connectionString))
            {
                string sql = @"SELECT * FROM PETS";

                connection.Open();
                SqlCommand cmd = new SqlCommand(sql, connection);
                SqlDataReader data = cmd.ExecuteReader();

                if (data.HasRows)
                {
                    while (data.Read())
                    {
                        Pet pet = new Pet();

                        pet.Id = Int32.Parse(data["Id"].ToString());
                        pet.Name = data["Name"].ToString();
                        pet.Notes = data["Notes"].ToString();
                        pet.IsOnCare = Boolean.Parse(data["IsOnCare"].ToString());

                        pets.Add(pet);
                    }
                }

                data.Dispose();
                cmd.Dispose();
            }

            return pets;
        }
 /// <summary>
 /// Add a new pet to the store
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// Pet object that needs to be added to the store
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task<Pet> AddPetAsync(this ISwaggerPetstoreV2 operations, Pet body, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddPetWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false))
     {
         return _result.Body;
     }
 }
Ejemplo n.º 3
0
     /// <summary>Add a new pet to the store</summary>
     /// <param name="body">Pet object that needs to be added to the store</param>
     /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
     /// <exception cref="SwaggerException">A server side error occurred.</exception>
     public async System.Threading.Tasks.Task AddPetAsync(Pet body, System.Threading.CancellationToken cancellationToken)
     {
         var url_ = string.Format("{0}/{1}", BaseUrl, "pet");
 
         using (var client_ = new System.Net.Http.HttpClient())
 		{
 			var request_ = new System.Net.Http.HttpRequestMessage();
 			PrepareRequest(client_, ref url_);
 			var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body));
 			content_.Headers.ContentType.MediaType = "application/json";
 			request_.Content = content_;
 			request_.Method = new System.Net.Http.HttpMethod("POST");
 			request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
 			var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken).ConfigureAwait(false);
 			ProcessResponse(client_, response_);
 
 			var responseData_ = await response_.Content.ReadAsByteArrayAsync().ConfigureAwait(false); 
 			var status_ = ((int)response_.StatusCode).ToString();
 
 			if (status_ == "405") 
 			{
 				throw new SwaggerException("Invalid input", status_, responseData_, null);
 			}
 			else
 			if (status_ != "200" && status_ != "204")
 				throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, null);
 		}
 	}
Ejemplo n.º 4
0
    public void StartUp()
    {
        // add prices to the dictionary, prices
          prices.Add("Dog", 120);
          prices.Add("Cat", 60);
          prices.Add("Snake", 40);
          prices.Add("Guinea pig", 20);
          prices.Add("Canary", 15);

        // create customers
        Customer c1 = new Customer(1001, "Susan", "Peterson", "Borgergade 45", "8000", "Aarhus", "[email protected]", "211a212121");
          Customer c2 = new Customer(1002, "Brian", "Smith", "Allegade 108", "8000", "Aarhus", "[email protected]", "45454545");

        //opret Employees
          Employee e1 = new Employee("Gitte", "Svendsen", "GIT", "234234234");
          Employee e2 = new Employee("Mads", "Juul", "MUL", "911112112");

          Pet p1 = new Pet("Dog", "Hamlet", new DateTime(2011, 9, 2),
                       new DateTime(2011,9,20), c1, e1);
          Pet p2 = new Pet("Dog", "Samson", new DateTime(2011, 9, 14),
                       new DateTime(2011, 9, 21), c1, e1);
          Pet p3 = new Pet("Cat", "Darla", new DateTime(2011, 9, 7),
                       new DateTime(2011, 9, 10), c2, e2);
          // add Pets to list of Pet, pets
          pets.Add(p1);
          pets.Add(p2);
          pets.Add(p3);

        // add customers to list
          customer.Add(c1);
          customer.Add(c2);
    }
Ejemplo n.º 5
0
 internal static void GenerateMessage(Pet pet)
 {
     ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("RespectPetComposer"));
     serverMessage.AppendInteger(pet.VirtualId);
     serverMessage.AppendBool(true);
     pet.Room.SendMessage(serverMessage);
 }
        public ActionResult CreatePet([DataSourceRequest]DataSourceRequest request, IEnumerable<AdministrationPetsViewModel> models)
        {
            var result = new List<AdministrationPetsViewModel>();
            if (this.ModelState.IsValid && models != null)
            {
                foreach (var model in models)
                {
                    var owner = this.users.GetByUsername(model.Owner).FirstOrDefault();
                    var breed = this.breeds.GetById(model.BreedId).FirstOrDefault();
                    var location = this.locations.GetById(model.LocationId).FirstOrDefault();
                    var status = this.petStatuses.GetById(model.PetStatusId).FirstOrDefault();
                    if (owner != null && breed != null && location != null && status != null)
                    {
                        var newPet = new Pet { Name = model.Name, Description = model.Description, Breed = breed, Owner = owner, Location = location, PetStatus = status, ImageUrl = model.ImageUrl, PetGender = model.PetGenderType };
                        this.pets.Add(newPet);
                        model.CreatedOn = newPet.CreatedOn;
                        model.Id = newPet.Id;
                        result.Add(model);
                    }
                }

                return this.Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
            }

            return null;
        }
Ejemplo n.º 7
0
 public Pet GetPet()
 {
     Pet pet = new Pet();
     pet.PetId = 1;
     pet.Name = "Tamo";
     return pet;
 }
        internal static void GenerateMessage(Pet pet, ServerMessage message, bool levelAfterName = false)
        {
            message.AppendInteger(pet.PetId);
            message.AppendString(pet.Name);

            if (levelAfterName)
                message.AppendInteger(pet.Level);

            message.AppendInteger(pet.RaceId);
            message.AppendInteger(pet.Race);
            message.AppendString(pet.Type == "pet_monster" ? "ffffff" : pet.Color);
            message.AppendInteger(pet.Type == "pet_monster" ? 0u : pet.RaceId);

            if (pet.Type == "pet_monster" && pet.MoplaBreed != null)
            {
                string[] array = pet.MoplaBreed.PlantData.Substring(12).Split(' ');
                string[] array2 = array;

                foreach (string s in array2)
                    message.AppendInteger(int.Parse(s));

                message.AppendInteger(pet.MoplaBreed.GrowingStatus);

                return;
            }

            message.AppendInteger(0);
            message.AppendInteger(0);
        }
 public Pet Pet_insert()
 {
     Pet.Pet_Location_Found_ID = Convert.ToInt32(Pet_Location_Found_ID_txt.Text);
     Pet.Pet_Type_ID = Convert.ToInt32(Pet_Type_ID_txt.Text);
     Pet.Pet_Vet_ID = Pet_Vet_ID_txt.Text;
     Pet.Pet_License_Tag = Pet_License_Tag_txt.Text;
     Pet.Pet_RFID = Pet_RFID_txt.Text;
     Pet.Pet_Tatoo_No = Pet_Tatoo_No_txt.Text;
     Pet.Pet_Name = Pet_Name_txt.Text;
     Pet.Pet_Gender = Pet_Gender_txt.Text;
     Pet.Pet_Color = Pet_Color_txt.Text;
     Pet.Pet_Weight = Convert.ToInt32(Pet_Weight_txt.Text);
     Pet.Pet_Description = Pet_Description_txt.Text;
     Pet.Pet_Condition = Pet_Condition_txt.Text;
     Pet.Pet_Status = Pet_Status_txt.Text;
     Pet.Pet_Date_Of_Birth = Convert.ToDateTime(Pet_Date_Of_Birth_txt.Text);
     byte[] uploaded_picture = FileUpload1.FileBytes;
     Pet.Pet_Picture = uploaded_picture;
     Pet.Pet_Sterilized = Pet_Sterilized_txt.Text;
     Pet.Date_Modified = Convert.ToDateTime(Date_Modified_txt.Text);
     Pet.Date_Created = Convert.ToDateTime(Date_Created_txt.Text);
     Pet = Pet.Insert(Pet);
     GridView1.DataBind();
     return Pet;
 }
Ejemplo n.º 10
0
        public static void JoinEx1()
        {
            Person magnus = new Person { Name = "Hedlund, Magnus" };
            Person terry = new Person { Name = "Adams, Terry" };
            Person charlotte = new Person { Name = "Weiss, Charlotte" };

            Pet barley = new Pet { Name = "Barley", Owner = terry };
            Pet boots = new Pet { Name = "Boots", Owner = terry };
            Pet whiskers = new Pet { Name = "Whiskers", Owner = charlotte };
            Pet daisy = new Pet { Name = "Daisy", Owner = magnus };

            List<Person> people = new List<Person> { magnus, terry, charlotte };
            List<Pet> pets = new List<Pet> { barley, boots, whiskers, daisy };

            // Create a list of Person-Pet pairs where
            // each element is an anonymous type that contains a
            // Pet's name and the name of the Person that owns the Pet.
            var query =
                people.Join(pets,
                            person => person,
                            pet => pet.Owner,
                            (person1, pet1) =>
                                new { OwnerName = person1.Name, Pet = pet1.Name });

            foreach (var obj in query)
            {
                Console.WriteLine(
                    "{0} - {1}",
                    obj.OwnerName,
                    obj.Pet);
            }
        }
Ejemplo n.º 11
0
        public MainVM()
        {
            var bobbyJoe = new Person("Bobby Joe", new[] { new Pet("Fluffy") });
            var bob = new Person("Bob", new[] { bobbyJoe });
            var littleJoe = new Person("Little Joe");
            var joe = new Person("Joe", new[] { littleJoe });
            Family = new ReactiveList<TreeItem> { bob, joe };

            _addPerson = ReactiveCommand.Create();
            _addPerson.Subscribe(_ =>
            {
                if (SelectedItem == null) return;
                var p = new Person(NewName);
                SelectedItem.AddChild(p);
                p.IsSelected = true;
                p.ExpandPath();
            });
            _addPet = ReactiveCommand.Create();
            _addPet.Subscribe(_ =>
            {
                if (SelectedItem == null) return;
                var p = new Pet(PetName);
                SelectedItem.AddChild(p);
                p.IsSelected = true;
                p.ExpandPath();
            });
            _collapse = ReactiveCommand.Create();
            _collapse.Subscribe(_ =>
            {
                SelectedItem?.CollapsePath();
            });
        }
Ejemplo n.º 12
0
    static void Main()
    {
        Person Ivan = new Person{ Name = "Ivan Petrov" };
        Person Gosho = new Person{ Name = "Gosho Georgiev" };
        Person Mara = new Person{ Name = "Kaka Mara" };

        Pet barley = new Pet{ Name = "Barley", Owner = Ivan };
        Pet boots = new Pet{ Name = "Boots", Owner = Ivan };
        Pet whiskers = new Pet{ Name = "Whiskers", Owner = Mara };
        Pet daisy = new Pet{ Name = "Daisy", Owner = Gosho };

        List<Person> people = new List<Person>{ Ivan, Gosho, Mara };
        List<Pet> pets = new List<Pet>{ barley, boots, whiskers, daisy };
        var query =
        //from person in people
        //   join p in pets on person equals p.Owner
        //   select new { OwnerName = person.Name, Pet = p.Name };
        people.Join(pets, person => person,
                    pet => pet.Owner,
                    (person, pet) =>
                    new { OwnerName = person.Name, Pet = pet.Name });

        foreach (var obj in query)
        {
            Console.WriteLine("{0} - {1}",
                              obj.OwnerName,
                              obj.Pet);
        }
    }
Ejemplo n.º 13
0
 internal static void GenerateMessage(Pet pet)
 {
     ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("PetRespectNotificationMessageComposer"));
     serverMessage.AppendInteger(1);
     serverMessage.AppendInteger(pet.VirtualId);
     pet.SerializeInventory(serverMessage);
     pet.Room.SendMessage(serverMessage);
 }
Ejemplo n.º 14
0
 public void dogIndexChanged(object sender, EventArgs e)
 {
     gvCat.SelectedIndex = -1;
     gvBird.SelectedIndex = -1;
     btnPurchase.Enabled = true;
     petToBuy = (Pet)dogList[gvDog.SelectedIndex];
     ViewState["pet"] = pet_dao.ObjectToString(petToBuy);
 }
Ejemplo n.º 15
0
        internal static void GenerateMessage(Pet pet, uint amount)
        {
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("AddPetExperienceMessageComposer"));

            serverMessage.AppendInteger(pet.PetId);
            serverMessage.AppendInteger(pet.VirtualId);
            serverMessage.AppendInteger(amount);
            pet.Room.SendMessage(serverMessage);
        }
Ejemplo n.º 16
0
 internal MoplaBreed(Pet Pet, uint PetId, int Rarity, string MoplaName, string BreedData, int LiveState, int GrowingStatus)
 {
     this.Pet = Pet;
     this.PetId = PetId;
     this.Rarity = Rarity;
     this.MoplaName = MoplaName;
     this.BreedData = BreedData;
     this.LiveState = (MoplaState)LiveState;
     this.GrowingStatus = GrowingStatus;
 }
 Regulus.Remoting.Value<IBattlerBehavior> IBattleAdmissionTickets.Visit(Pet pet)
 {
     Regulus.Remoting.Value<IBattlerBehavior> rce = new Remoting.Value<IBattlerBehavior>();
     ReadyInfomation ri = (from readyInfomation in _ReadyInfomations where readyInfomation.Battler.Id == pet.Owner && readyInfomation.Pet == null select readyInfomation).FirstOrDefault();
     if (ri != null)
     {
         ri.Pet = pet;
         ri.BattleBehavior = rce;
         _Count++;
     }
     return rce;
 }
Ejemplo n.º 18
0
 Regulus.Remoting.Value<Pet> IStorage.FindPet(Guid id)
 {
     var pet = new Pet() { Id = Guid.NewGuid(), Owner = id };
     pet.Energy = new Energy(7);
     Func<bool>[] energyIncs = new Func<bool>[]{pet.Energy.IncGreen , pet.Energy.IncRed , pet.Energy.IncYellow };
     /*for(int i = 0 ; i < 3 ; ++i)
     {
         energyIncs[Regulus.Utility.Random.Next(0, 3)]();
     }*/
     pet.Name = _Count++ % 2 == 0 ? "蝙蝠" : "甲蟲";
     return pet;
 }
Ejemplo n.º 19
0
    public static void Main()
    {
        Console.WriteLine("Pet Properties");

        // Create a new Person object:
        Pet pet = new Pet();

        // Print out the name and the age associated with the person:
        Console.WriteLine("Pet details - {0}", pet);
        pet.Name = "Doge";
        pet.Age = 99;
        pet.Sex = "male";
        pet.Type = "Shiba Inu";
        Console.WriteLine("Pet details - {0}", pet);
    }
Ejemplo n.º 20
0
 public override void Awake()
 {
     base.Awake();
     atkAnimKeyFrame = 14;
     if (GotoProxy.getSceneName() != GotoProxy.SKILLTREE
         && GotoProxy.getSceneName() != GotoProxy.YOUR_TEAM
         && GotoProxy.getSceneName() != GotoProxy.COMBINED_ARMORY
         && GotoProxy.getSceneName() != GotoProxy.ARMORY )
     {
         GameObject petObj = Instantiate(petPrb, gameObject.transform.position, gameObject.transform.rotation) as GameObject;
         pet = petObj.GetComponent<Pet>();
         pet.selectMaster(this);
     }
     isTigersClaw = false;
 }
Ejemplo n.º 21
0
 public HomeModule()
 {
     Get["/"] = _ => {
     List<Pet> allPets = Pet.GetAll();
     if (allPets.Count >=0)
     {
       return View["index.cshtml",allPets];
     }
     else
     {
       return View["index.cshtml"];
     }
       };
       Post["/"] = _ => {
     Pet newPet = new Pet(Request.Form["new-pet"]);
     List<Pet> allPets = Pet.GetAll();
     return View["index.cshtml", allPets];
       };
       Post["/time"]= _ =>{
     Pet.TimePass();
     List<Pet> allPets = Pet.GetAll();
     return View["index.cshtml", allPets];
       };
       Get["/pets/{id}"] = parameters => {
     Pet pet = Pet.Find(parameters.id);
     return View["/pet.cshtml", pet];
       };
       Post["/pets/{id}/food"]= parameters =>{
     Pet pet = Pet.Find(parameters.id);
     Pet.FeedPet(pet);
     return View["pet.cshtml", pet];
       };
       Post["/pets/{id}/attention"]= parameters =>{
     Pet pet = Pet.Find(parameters.id);
     Pet.AttentionPet(pet);//increase attention
     return View["pet.cshtml", pet];
       };
       Post["/pets/{id}/rest"]= parameters =>{
     Pet pet = Pet.Find(parameters.id);
     Pet.RestPet(pet);//increase rest
     return View["pet.cshtml", pet];
       };
       Post["/clear"]= _ =>{
     List<Pet> allPets = Pet.GetAll();
     Pet.ClearAll();
     return View["index.cshtml", allPets];
       };
 }
Ejemplo n.º 22
0
 public HunterPet(Pet k, int str, int agi, int sta, int intel, int spi, int ap, int dmgMin, int dmgMax, double atkspeed, double dps, int sp, int ar)
 {
     //kind = k;
     strength = str;
     agility = agi;
     //baseStamina = sta;
     //baseIntelect = intel;
     spirit = spi;
     //baseAttackPower = ap;
     damageMin = dmgMin;
     damageMax = dmgMax;
     attackSpeed = atkspeed;
     dmgpersec = dps;
     //baseSpellPower = sp;
     //baseArmor = ar;
 }
Ejemplo n.º 23
0
        internal static void GenerateMessage(Pet pet, Dictionary<uint, PetCommand> totalPetCommands, Dictionary<uint, PetCommand> petCommands, GameClient owner)
        {
            ServerMessage serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("PetTrainerPanelMessageComposer"));

            serverMessage.AppendInteger(pet.PetId);

            serverMessage.AppendInteger(totalPetCommands.Count);

            foreach (uint sh in totalPetCommands.Keys)
                serverMessage.AppendInteger(sh);

            serverMessage.AppendInteger(petCommands.Count);

            foreach (uint sh in petCommands.Keys)
                serverMessage.AppendInteger(sh);

            owner.SendMessage(serverMessage);
        }
Ejemplo n.º 24
0
    void Start()
    {
        popupInstantiated = false;
        instance = this;
        instance.m_lastPlayTime = lastP;
        m_hunger = new Desire(Desire.DesireType.Hunger, 1);
        m_hapiness = new Desire(Desire.DesireType.Hapiness, 1);
        m_sleep = new Desire(Desire.DesireType.Sleep, 1);
        m_inventory = new List<Item>();
        updateDesiresSinceLastPlayed();
        m_hunger.setDemand(hungerD);
        m_hapiness.setDemand(happyD);
        m_sleep.setDemand(sleepD);
        StartCoroutine(desireLoop());

        hungerD = 0; sleepD = 0; happyD = 0;
        lastP = System.DateTime.MinValue;
    }
Ejemplo n.º 25
0
 internal static MoplaBreed CreateMonsterplantBreed(Pet Pet)
 {
     MoplaBreed breed = null;
     if (Pet.Type == 16)
     {
         Tuple<string, string> tuple = GeneratePlantData(Pet.Rarity);
         breed = new MoplaBreed(Pet, Pet.PetId, Pet.Rarity, tuple.Item1, tuple.Item2, 0, 1);
         using (IQueryAdapter adapter = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
         {
             adapter.setQuery("INSERT INTO bots_monsterplants (pet_id, rarity, plant_name, plant_data) VALUES (@petid , @rarity , @plantname , @plantdata)");
             adapter.addParameter("petid", Pet.PetId);
             adapter.addParameter("rarity", Pet.Rarity);
             adapter.addParameter("plantname", tuple.Item1);
             adapter.addParameter("plantdata", tuple.Item2);
             adapter.runQuery();
         }
     }
     return breed;
 }
Ejemplo n.º 26
0
    public static void Main()
    {
        Pet fluffy = new Pet();
        fluffy.Name = "Fluffy";
        fluffy.Species = "Cat";
        fluffy.Age = 5;

        Pet spot = new Pet();
        spot.Name = "Spot";
        spot.Species = "Dog";
        spot.Age = 5;

        Pet ace = new Pet();
        ace.Name = "Ace";
        ace.Species = "Dog";
        ace.Age = 8;

        Pet tom = new Pet();
        tom.Name = "Tom";
        tom.Species = "Cat";
        tom.Age = 5;

        List<Pet> Pets = new List<Pet>() {fluffy, spot, ace, tom};
        foreach(Pet animal in Pets)
        {
          Console.WriteLine(animal.Name);
        }
          Console.WriteLine("Enter the maximum age pet you are looking for.");
          string stringMaxAge = Console.ReadLine();
          int maxAge = int.Parse(stringMaxAge);
          List <Pet> PetsMatchingSearch = new List<Pet>();
          foreach(Pet animal in Pets)
          {
        if (animal.Age <= maxAge)
        {
          PetsMatchingSearch.Add(animal);
        }
          }
          foreach(Pet animal in PetsMatchingSearch)
          {
        Console.WriteLine(animal.Name);
          }
    }
Ejemplo n.º 27
0
        public Pet Add(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return null;
            }

            var pet = new Pet() { Name = name };
            this.petsRepo.Add(pet);
            try
            {
                this.petsRepo.Save();
                return this.petsRepo.All().Where(x => x.Name == name).FirstOrDefault();
            }
            catch (Exception)
            {
                // log
                return null;
            }
        }
Ejemplo n.º 28
0
 public string Upload(Pet pet)
 {
     var restClient = new RestClient {BaseUrl = "http://ec2-107-20-224-204.compute-1.amazonaws.com/node"};
     byte[] readBuffer = new IsolatedStorageService().ReadImageFromIsolatedStorage("myWP7.dat");
     IRestRequest restRequest = new RestRequest(Method.POST)
         .AddFile("file", readBuffer, pet.PictureUri.LocalPath)
         .AddParameter("breed", pet.Breed)
         .AddParameter("contact", pet.Contact)
         .AddParameter("contactMethod", pet.ContactMethod)
         .AddParameter("when", pet.DateWhen)
         .AddParameter("description", pet.Description)
         .AddParameter("dogOrCat", pet.DogOrCat)
         .AddParameter("foundAround", pet.FoundAround)
         .AddParameter("name", pet.Name)
         .AddParameter("size", pet.Size)
         .AddParameter("status", pet.Status);
     /*var callback = new Action<RestResponse>(delegate { });
     restClient.ExecuteAsync(restRequest, callback);*/
     return "http://www.lostpets.com";
 }
Ejemplo n.º 29
0
        public Pet Create(string name, int age, string ownerId, PetGender gender, int speciesId, string picture = null)
        {
            if (picture == string.Empty)
            {
                picture = "http://s.hswstatic.com/gif/animal-stereotype-orig.jpg";
            }

            var pet = new Pet
            {
                Name = name,
                Age = age,
                OwnerId = ownerId,
                Gender = gender,
                SpeciesId = speciesId,
                Picture = picture
            };

            this.pets.Add(pet);
            this.pets.Save();

            return pet;
        }
Ejemplo n.º 30
0
        public bool Add(Pet pet)
        {
            bool isSuccess = false;

            //insert on db
            using (SqlConnection connection = new SqlConnection(this.connectionString))
            {
                string sql = @"INSERT INTO Pets (Name, IsOnCare)
                                VALUES (@name,@isOnCare);";
                connection.Open();
                SqlCommand cmd = new SqlCommand(sql, connection);
                cmd.Parameters.AddWithValue("@name", pet.Name);
                cmd.Parameters.AddWithValue("@isOnCare", pet.IsOnCare);

                if (cmd.ExecuteNonQuery() > 0)
                {
                    isSuccess = true;
                }
            }

            return isSuccess;
        }