Exemple #1
0
        public static Avatar LoadById(int ID)
        {
            DataSet ds = ExecuteQuery("SELECT * FROM TAvatar WHERE AvatarID=" + ID);
            Avatar m = new Avatar(ds.Tables[0].Rows[0]);

            return m;
        }
Exemple #2
0
        public static Avatar LoadByName(string tipo)
        {
            DataSet ds = ExecuteQuery("SELECT * FROM TAvatar WHERE Designacao='" + tipo + "'");
            Avatar av = new Avatar(ds.Tables[0].Rows[0]);

            return av;
        }
Exemple #3
0
        public static IList LoadAll()
        {
            try
            {
                DataSet ds = ExecuteQuery(GetConnection(false), "SELECT * from TAvatar");

                IList ret = new ArrayList();

                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    Avatar av = new Avatar(r);
                    ret.Add(av);

                    //apagar
                    // save in registry
                    //loaded[p.ID] = p;
                }

                return ret;
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Erro BD", ex);
            }
        }