Esempio n. 1
0
		public static CharacterItem Load(DataRow row) {
			CharacterItem item = new CharacterItem();
			if (item.LoadFromDatabase(row) == false) {
				return null;
			}

			return item;
		}
Esempio n. 2
0
        public static CharacterItem Load(DataRow row)
        {
            CharacterItem item = new CharacterItem();

            if (item.LoadFromDatabase(row) == false)
            {
                return(null);
            }

            return(item);
        }
        public void LoadCart()
        {
            Cart.Clear();
            DataTable table = Core.Database.Query("SELECT * FROM `char_cart` WHERE `charID` = {0}", ID);

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            foreach (DataRow row in table.Rows)
            {
                CharacterItem item = CharacterItem.Load(row);
                if (item == null)
                {
                    ServerConsole.ErrorLine("Failed to load char cart item #{0}", row.Field <int>("id"));
                    continue;
                }

                Cart.Add(item);
            }
        }