예제 #1
0
        public string PostPokemon(clsInventory prPokemon)
        {
            Dictionary <string, object> par = new Dictionary <string, object>(1);

            par.Add("pokeDexNo", prPokemon.pokeDexNo);
            par.Add("name", prPokemon.name);
            par.Add("description", prPokemon.description);
            par.Add("dustcost", prPokemon.dustcost);
            par.Add("quantity", prPokemon.quantity);
            par.Add("gender", prPokemon.gender);
            par.Add("evolvable", prPokemon.evolvable);
            par.Add("candycostofevolution", prPokemon.candycostofevolution);
            par.Add("nextevolutionname", prPokemon.nextevolutionname);
            par.Add("dustcostofnextmove", prPokemon.dustcostofnewmove);
            par.Add("typename", prPokemon.typename);
            int lcRecordcount = clsDbConnection.Execute("INSERT INTO inventory (pokeDexNo, name, description, dustcost, datemodified, quantity, gender, evolvable, candycostofevolution, nextevolutionname, dustcostofnewmove, typename) VALUES (@pokeDexNo, @name, @description, @dustcost, now(), @quantity, @gender, @evolvable, @candycostofevolution, @nextevolutionname, @dustcostofnextmove, @typename)", par);

            if (lcRecordcount == 1)
            {
                return("Sucessfully Added");
            }
            else
            {
                return("Failed");
            };
        }
예제 #2
0
        public string PutPokemon(clsInventory prPokemon)
        {
            Dictionary <string, object> par = new Dictionary <string, object>(1);

            par.Add("pokeDexNo", prPokemon.pokeDexNo);
            par.Add("name", prPokemon.name);
            par.Add("description", prPokemon.description);
            par.Add("dustcost", prPokemon.dustcost);
            par.Add("quantity", prPokemon.quantity);
            par.Add("gender", prPokemon.gender);
            int lcRecordcount = clsDbConnection.Execute("UPDATE inventory SET name = @name, description = @description, dustcost = @dustcost, datemodified = now(), quantity = @quantity, gender = @gender WHERE pokeDexNo = @pokeDexNo;", par);

            if (lcRecordcount == 1)
            {
                return("Sucessfully Added");
            }
            else
            {
                return("Failed");
            };
        }