コード例 #1
0
        public List <Permissao> GetAll()
        {
            IDbCommand comando = DB.GetCommand();

            comando.CommandType = CommandType.Text;
            comando.CommandText = "Select * From PermissaoTB";

            DataTable dt = new DataTable();

            dt.Load(comando.ExecuteReader());

            List <Permissao> lstPermissao = new List <Permissao>();
            Permissao        permissao;

            foreach (DataRow dr in dt.Rows)
            {
                permissao      = new Permissao();
                permissao.Id   = dr["id"].ToInteger();
                permissao.Tipo = dr["tipo"].ToString();

                lstPermissao.Add(permissao);
            }
            return(lstPermissao);
        }